Public Repository

Last pushed: a year ago
Short Description
Use this container to build #golang programs compatible with the oh-so-tiny Alpine Linux container.
Full Description

Supported Tags

  • latest which happens to be go 1.6.4-r2 from the Alpine package repo.

How to Use This Container

The working directory is /opt/go/ within which there are two directories: src/ and 'bin/'. The best way to use this container is to run it with two volumes configured:

  1. A volume that mounts wherever you want the compiled #golang bits to go.
  2. A volume that mounts wherever you have your go/src/ directory with the code you want to compile.

Example 1: Build your own Go program for Alpine Linux

Assuming you have two directories,

  • /home/ME/go/src/ where you do your local #golang development, and
  • /home/ME/alpine/go/ which you have created to hold your Alpine Linux-specific binaries,
  • and you have a #golang program in the source directory /home/ME/go/src/example/hello/,

Run the following docker command to compile your program so that the compiled binary hello ends up in /home/ME/alpine/go/bin/:

docker run --rm --name alpinegodev \
       -v /home/ME/alpine/go/:/opt/go \
       -v /home/ME/go/src/:/opt/go/src \
       methinksnot/alpine-go \
       go install -v example/hello

If the compile succeeds without errors, you will find the hello binary in your /home/ME/alpine/go/bin/ folder.

Docker Pull Command
Owner
methinksnot

Comments (0)