Sending ENV keys in a multi stage build

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Hello all! I have a Golang application which uses Github V4 API. So I got the github access token from the Github UI. I store it in a .env file. I have a multistage build like the following: FROM golang:1.14.4-alpine3.12 AS builder RUN mkdir /app WORKDIR /app COPY go.sum . COPY go.mod . COPY .env . RUN go mod download ADD . /app RUN CGO_ENABLED=0 GOOS=linux go build -o main . FROM scratch COPY –from=builder /app/main /app/main CMD [“/app/main”] But when I run the image, the image cannot find the .env file and I’m not able to access the public API. How do you generally pass env keys in case of multistage build? Is there anything wrong with my Dockerfile itself? Any help is highly appreciated. Thank you 🙂 submitted by /u/iammunukutla [link] [comments]

X ITM Cloud News

Patricia

Leave a Reply

Next Post

How to resolve AWS DNS names in Swarm?

Sat Aug 1 , 2020
Spread the love          Hey all! I’ve been trying to connect to an Elasticache Redis cluster from a Swarm deployed to an EC2 instance. We are still in the very early stages of development, and we only have one manager node. I understand the basics of DNS resolution inside the Swarm, but […]
X- ITM

Cloud Computing – Consultancy – Development – Hosting – APIs – Legacy Systems

X-ITM Technology helps our customers across the entire enterprise technology stack with differentiated industry solutions. We modernize IT, optimize data architectures, and make everything secure, scalable and orchestrated across public, private and hybrid clouds.

This image has an empty alt attribute; its file name is x-itmdc.jpg

The enterprise technology stack includes ITO; Cloud and Security Services; Applications and Industry IP; Data, Analytics and Engineering Services; and Advisory.

Watch an animation of  X-ITM‘s Enterprise Technology Stack

We combine years of experience running mission-critical systems with the latest digital innovations to deliver better business outcomes and new levels of performance, competitiveness and experiences for our customers and their stakeholders.

X-ITM invests in three key drivers of growth: People, Customers and Operational Execution.

The company’s global scale, talent and innovation platforms serve 6,000 private and public-sector clients in 70 countries.

X-ITM’s extensive partner network helps drive collaboration and leverage technology independence. The company has established more than 200 industry-leading global Partner Network relationships, including 15 strategic partners: Amazon Web Services, AT&T, Dell Technologies, Google Cloud, HCL, HP, HPE, IBM, Micro Focus, Microsoft, Oracle, PwC, SAP, ServiceNow and VMware

.

X ITM