Created
August 15, 2018 17:03
-
-
Save jeffotoni/29e64de6f07f9415ea1858dcd6a36708 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dockerfile ◀◀ buffers | |
# Start by building the application. | |
FROM golang:1.10 as build | |
WORKDIR /go/src/app | |
COPY . . | |
# RUN go get -d -v ./... | |
RUN go install -v ./... | |
# Now copy it into our base image. | |
FROM gcr.io/distroless/base | |
COPY --from=build /go/bin/app / | |
CMD ["/app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
multi-stage usando alpine
Start by building the application.
FROM golang:1.10 as builder
RUN mkdir /go/src/app
WORKDIR /go/src/app
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
RUN cp /go/src/app/app /go/bin/app
Now copy it into our base image.
FROM alpine:3.8
WORKDIR /
COPY --from=builder /go/bin/app /
RUN chmod +x /app
RUN apk add --update bash
RUN apk --no-cache add ca-certificates
CMD ["/app"]