Commit 68d438c8 authored by Mike Shoup's avatar Mike Shoup

Copy compiled binary to alpine image

parent 14af5095
FROM golang:onbuild
FROM golang:onbuild as build-env
ADD main.go /go/src/app/
WORKDIR /go/src/app
RUN go get .
RUN go build -o main .
CMD ["/go/src/app/main"]
RUN CGO_ENABLED=0 go build -a -ldflags '-w -extldflags "-static"' -o main .
FROM alpine
RUN adduser -D -H appuser
COPY --from=build-env /go/src/app/main .
USER appuser
CMD ["/app/main"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment