https://github.com/vmj/golang-dep
Go container image with dep preinstalled
https://github.com/vmj/golang-dep
docker-image golang
Last synced: 2 months ago
JSON representation
Go container image with dep preinstalled
- Host: GitHub
- URL: https://github.com/vmj/golang-dep
- Owner: vmj
- Created: 2018-02-13T14:47:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-10T07:23:33.000Z (over 7 years ago)
- Last Synced: 2025-03-11T07:33:53.341Z (over 1 year ago)
- Topics: docker-image, golang
- Language: Makefile
- Homepage: https://hub.docker.com/r/vmj0/golang-dep/
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
# Go with Dep preinstalled
NOTE: This is deprecated and I'm not going to maintain this for long. I've switched to https://github.com/golang/go/wiki/Modules[Go 1.11 modules].
Base image is `golang:1.11.1-stretch` and `dep v0.5.0` is installed into `$GOPATH/bin`,
so `dep` command is available in `$PATH`.
## Example usage
Say you've got a program called `foo`. In your `Dockerfile`:
FROM vmj0/golang-dep:1.11.1-stretch-0.5.0 as build
# Build a static binary
WORKDIR /go/src/github.com/user/foo
COPY Gopkg.* *.go ./
RUN dep ensure && CGO_ENABLED=0 go build -a -o foo
# Build a minimal container image
FROM sratch
COPY --from=build /go/src/github.com/user/foo/foo /
CMD ["/foo"]