Skip to content

Instantly share code, notes, and snippets.

@unders
Last active August 29, 2015 14:27
Show Gist options
  • Select an option

  • Save unders/eca483da06f19effd2fc to your computer and use it in GitHub Desktop.

Select an option

Save unders/eca483da06f19effd2fc to your computer and use it in GitHub Desktop.
A mininal docker file
FROM gliderlabs/alpine:3.2 # 1. tiny container
MAINTAINER: Anders Törnqvist <...@...com>
RUN apk add --update ca-certificates bash
COPY . go/src/github.com/unders/program # 2. copy your sorce code
RUN apk add go got mercurial \ # 3. add dependencies
&& cd /go/src/github.com/unders/program \
&& export GOPATH=/go \
&& go get -t \ # 4. resovel deps
&& go test ./... \ # 5. run tests
go build -o /bin/program \ # 6. build
&& rm -rf /go \ # 7. remove everything
&& apk del --purge go git mercurial
ENTRYPOINT ["/bin/program"] # 8. Launch program
# Video
https://www.youtube.com/watch?v=02w8VjBIDis&list=PL2ntRZ1ySWBeHqlHM8DmvS8axgbrpvF9b&index=5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment