08_multistage_02_ARG

command
v0.0.0-...-168f94b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

ARG SECRET=secret

FROM golang:1.16.5-alpine

ARG SECRET

ENV GO111MODULE=auto GOPATH=/go

WORKDIR /go/application/

COPY . .

RUN apk add --update git && \
    rm -rf /var/cache/apk/*/apk/* && \
    go mod init module && \
    go mod tidy && \
    go get ./... && \
    go build -o /app .


FROM alpine:3.10.3

COPY --from=0 /app /app

ARG SECRET

RUN echo $SECRET > /file

CMD ["/app"]
user@server:~/gocalc$ sudo docker build . -t dkr-15-gocalc

user@server:~/gocalc$ sudo docker run 271a33cb9b4b cat /file
secret

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL