Skip to content

tcnksm/dockerfile-go-release

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dockerfile-go-release MIT License

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.

Supported tags

tcnksm/go-release image support below tags. Link is its Dockerfile.

Tag is correspond to its golang version.

Usage

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").

Example

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

Build image

To build this image, change directory named by its $TAG and run build,

$ cd $TAG
$ docker build -t tcnksm/go-release:$TAG . 

GitHub Token

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.

Contribution

  1. Fork (https://github.com/tcnksm/dockerfile-go-release/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Push it to your remote repository
  6. Create new Pull Request

Author

Taich Nakashima

About

Dockerfile for cross-compiling & uploading artifacts to Github Release page. Compiling and uploading are executed parallelly.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages