tcnksm/go-release Repository | Docker Hub Registry - Repositories of Docker Images
Dockerfile for cross-compiling (mitchell/gox) & uploading artifacts to Github Release page (tcnksm/ghr). Compiling and uploading are executed parallelly.
tcnksm/go-release
image support below tags. Link is its Dockerfile
.
Tag is correspond to its golang version.
To cross-compile & upload current directory project,
$ docker run --rm -v $(pwd):/gopath/${$(pwd)#*${GOPATH}/} -w /gopath/${$(pwd)#*${GOPATH}/} tcnksm/go-release:1.5-beta VERSION USER TOKEN
You need to specify VERSION
, USER
(Github username) and GITHUB_TOKEN
.
tcnksm/go-release
calls mitchell/gox and tcnksm/ghr. To set additional option of them, use GOX_OPT
and GHR_OPT
env ver. For example, if you want to set --replace
option for ghr, set it via docker run-e
option (-e "GHR_OPT=--replace"
).
For example, to cross-compile and upload tcnksm/license with 0.1.1
version,
$ cd $GOPATH/src/github.com/tcnksm/license/
docker run --rm -v $(pwd):/gopath/${$(pwd)#*${GOPATH}/} -w /gopath/${$(pwd)#*${GOPATH}/} tcnksm/go-release:1.5-beta 0.1.1 tcnksm $TOKEN
To build this image, change directory named by its $TAG
and run build,
$ cd $TAG
$ docker build -t tcnksm/go-release:$TAG .
To be able to use this step, you will first need to create a GitHub token with an account which has enough permissions to be able to create releases. First goto Account settings
, then goto Applications
for the user. Here you can create a token in the Personal access tokens
section. For a private repository you will need the repo
scope and for a public repository you will need the public_repo
scope. Then it is recommended to save this token on wercker as a protected environment variable.
- Fork (https://github.com/tcnksm/dockerfile-go-release/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Push it to your remote repository
- Create new Pull Request