Skip to content
This repository has been archived by the owner. It is now read-only.
No description, website, or topics provided.
Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile
README.md

README.md

Go Builder (Cross Compiler)

The builder uses gox package to cross-compile for target os/architecture combinations.

Usage

Clone the Go package into src/<package_name>.

E.g. for package code.linksmart.eu/sc/service-catalog:

git clone https://code.linksmart.eu/scm/sc/service-catalog.git src/code.linksmart.eu/sc/service-catalog

Run the builder

  • Mount /data to the current directory on host
  • Pass package name as PACKAGE environment variable
docker run --rm -v `pwd`:/data -e PACKAGE=code.linksmart.eu/sc/service-catalog docker.linksmart.eu/ci/go-builder

By default, the builder uses bin/{{.Dir}}-{{.OS}}-{{.Arch}} naming template and cross-compiles for the following os/arch combinations:

  • linux/amd64
  • linux/arm
  • windows/amd64
  • darwin/amd64

These can be overriden by setting OSARCH and OUTPUT environment variable. E.g.:

docker run --rm -v `pwd`:/data -e PACKAGE=code.linksmart.eu/sc/service-catalog -e OSARCH="linux/arm linux/amd64" docker.linksmart.eu/ci/go-builder

Additionally, ldflags can be passed to the compiler by setting LDFLAGS environment variable.

You can’t perform that action at this time.