Skip to content

Instantly share code, notes, and snippets.

@scriptonist
Created March 27, 2019 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scriptonist/44e8d302f003d32903b514ca307c4370 to your computer and use it in GitHub Desktop.
Save scriptonist/44e8d302f003d32903b514ca307c4370 to your computer and use it in GitHub Desktop.
Cached Deps golang Dockerfile
FROM golang:1.12-alpine
RUN apk add -U --no-cache git ca-certificates
ADD go.mod go.sum m/ RUN cd m && go mod download
ADD . m/
RUN cd m && go install -mod=readonly ./cmd/foo
RUN go clean -modcache -cache std
ENTRYPOINT ["foo"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment