Public | Automated Build

Last pushed: a month ago
Short Description
This is a container for building various versions of a Golang application using source-to-image.
Full Description

[[go-docker-images]]
= Go Docker images

This repository contains the source for creating a
https://github.com/openshift/source-to-image[source-to-image] builder image,
which be used to create reproducible Docker images from your Go project's
source code. The resulting image can be run using https://docker.com[Docker].

For more information about using these images with the Digital Garage, please see
the official
https://docs.thedigitalgarage.io/using_images/s2i_images/php.html[Digital Garage
Documentation].

[[versions]]
== Versions

Go versions currently supported are:

  • Go 1.4.3
  • Go 1.5.3
  • Go 1.6
  • Go 1.7

The following operating system base images are supported:

  • CentOS 7

[[installation]]
== Installation

To build a Go builder image, execute:


$ git clone https://github.com/thedigitalgarage/s2i-go.git
$ cd s2i-go

$ make build VERSION=1.7

Alternatively, you can pull the CentOS image from Docker Hub via:


$ docker pull thedigitalgarage/s2i-go:1.7

Notice: By omitting the VERSION parameter, the build/test action will
be performed on all the supported versions of Go.

[[usage]]
== Usage

There are several sample Go applications included with this repository. To
build a simple Go test application using the standalone


$ s2i build https://github.com/thedigitalgarage/s2i-go.git \

--context-dir=1.4/test/test-app thedigitalgarage/s2i-go:1.7 go-test-app

The resulting image can be executed using https://docker.com[docker]:


$ docker run --rm -p 8080:8080 go-test-app

Once the container is running, it should be accessible using:


$ curl 127.0.0.1:8080

[[test]]
== Test

This repository also provides a test suite to check functionality of
simple Go applications built on top of the s2i-go image. It can be
executed simply by running the make test command:


$ cd s2i-go

$ make test VERSION=1.4

Notice: By omitting the VERSION parameter, the build/test action will
be performed on all the supported versions of Go.

[[repository-organization]]
Repository organization
~~~~~~~

  • <go-version>: Dockerfile to build container images from.

* <go-version>/test/test-app*: Sample Go application used for tests.

  • hack/: Folder containing scripts which are responsible for the build
    and test actions performed by the Makefile.

  • s2i/: Build scripts which will be injected into the builder image
    and executed during application source code builds.

Docker Pull Command
Owner
thedigitalgarage
Source Repository