An open API service indexing awesome lists of open source software.

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

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"]