Skip to content

Instantly share code, notes, and snippets.

@jpillora
Created March 11, 2016 05:08
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 jpillora/640b475f02edb746b773 to your computer and use it in GitHub Desktop.
Save jpillora/640b475f02edb746b773 to your computer and use it in GitHub Desktop.
small generic Go (golang) docker file (~11MB)
FROM alpine
MAINTAINER dev@jpillora.com
#configure go path
ENV GOPATH /root/go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
#package
ENV PACKAGE github.com/jpillora/ssh-tron
#install go and deps, then package,
#move build binaries out then wipe build tools
RUN apk update && \
apk add git go gzip && \
go get -v $PACKAGE && \
mv $GOPATH/bin/* /usr/local/bin/ && \
rm -rf $GOPATH && \
apk del git go gzip && \
echo "Installed $PACKAGE"
#alternatively, git clone into $GOPATH/src,
#then go get -u $PACKAGE to update deps
#run package
CMD ["ssh-tron"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment