docker build -t oops .
docker run oops
Last active
October 16, 2018 22:14
-
-
Save adelowo/9d3dded0b548b715bc4386c4829b339f to your computer and use it in GitHub Desktop.
Golang with module support and an extremely tiny Docker image that wouldn't stress you as "Scratch" would
This file contains hidden or 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
FROM golang:1.11 as build-env | |
WORKDIR /go/src/github.com/adelowo/project-with-go-mod | |
ADD . /go/src/github.com/adelowo/project-with-go-mod | |
ENV GO111MODULE=on | |
RUN go mod download | |
RUN go mod verify | |
RUN go install ./cmd | |
FROM gcr.io/distroless/base | |
COPY --from=build-env /go/bin/cmd / | |
CMD ["/cmd"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This assumes, your
package main
is in./cmd
...