Public | Automated Build

Last pushed: a year ago
Short Description
Golang app builder
Full Description

Docker Golang builder

Docker image for building Golang projects, the image is based on CentOS7.

This docker image will produce another docker image, named $DOCKER_IMAGE.

Requirements

  • Access to Docker daemon socket.
  • Dockerfile, it must be located on the root directory of the project to be built.

Usage

$ mkdir -p src/github.com/username/project
$ git clone https://github.com/username/project src/github.com/username/project

$ docker run --rm -e DOCKER_IMAGE="image-name:latest" \
  -e PROJECT_PATH="github.com/username/project"
  -e APP_NAME="app_name" \
  -e APP_VERSION="`git describe --tags" \
  -v "$$PWD/src:/go/src" \
  -v /var/run/docker.sock:/var/run/docker.sock tripledes/centos-golang-builder

Environment variables

  • PROJECT_PATH: Path to the source code, default none
  • APP_NAME: It'll be used for the binary name, default project name
  • DOCKER_IMAGE: Docker image name, default none
  • APP_VERSION: It can be used on the Dockerfile as ARG, e.g. for labels, default none
  • DOCKER_BUILD: Override docker build parameters, default build
  • GO_BUILD: Override go build parameters, default build

Working examples

Versions

  • Go 1.6.x
  • Docker 1.11.x
Docker Pull Command
Owner
tripledes
Source Repository

Comments (0)