|
|
1d434f7 |
Golang s2i container image
|
|
|
1d434f7 |
===================
|
|
|
24702d6 |
|
|
|
1d434f7 |
This repository contains the source for building various versions of
|
|
|
1d434f7 |
the Go application as a reproducible s2i container image.
|
|
|
1d434f7 |
Users can choose between RHEL, Fedora and CentOS based builder images.
|
|
|
1d434f7 |
The resulting image can be run using [podman](https://github.com/containers/libpod), [Docker](http://docker.io) or using [source-to-image](https://github.com/openshift/source-to-image/).
|
|
|
1d434f7 |
Also the whole pipeline from build to app deployment could be run on top of the [Openshift Origin](https://www.okd.io/) or [Red Hat's Openshift](https://www.openshift.com/).
|
|
|
1d434f7 |
|
|
|
1d434f7 |
|
|
|
1d434f7 |
Usage
|
|
|
1d434f7 |
---------------------
|
|
|
1d434f7 |
|
|
|
1d434f7 |
Simplest usage via s2i:
|
|
|
1d434f7 |
|
|
|
1d434f7 |
s2i build ./src centos/go-toolset-7-centos7:latest test-app
|
|
|
1d434f7 |
|
|
|
1d434f7 |
where ./src directory contains git repository with golang application that has complete dependencies. You can't use incremental build in this case.
|
|
|
1d434f7 |
|
|
|
1d434f7 |
or
|
|
|
1d434f7 |
|
|
|
1d434f7 |
s2i build -e IMPORT_URL='github.com/cpuguy83/go-md2man' ./src centos/go-toolset-7-centos7:latest test-app
|
|
|
1d434f7 |
|
|
|
1d434f7 |
where ./src directory contains git repository with golang application(in this case github.com/cpuguy83/go-md2man) that has complete or incomplete dependencies. You can use incremental build in this case.
|
|
|
1d434f7 |
|
|
|
1d434f7 |
Both will build test-app application image.
|
|
|
1d434f7 |
|
|
|
1d434f7 |
Environment variables
|
|
|
1d434f7 |
---------------------
|
|
|
1d434f7 |
|
|
|
1d434f7 |
To set these environment variables, you can place them as a key value pair into a `.s2i/environment`
|
|
|
1d434f7 |
file inside your source code repository or specified via s2i invocation.
|
|
|
1d434f7 |
|
|
|
1d434f7 |
|
|
|
1d434f7 |
* **IMPORT_URL**
|
|
|
1d434f7 |
|
|
|
1d434f7 |
Used to specify the golang application import URL (i.e. usually something like github.com/someorg/somerepo), that is build. Necessary for the incremental build to function.
|
|
|
1d434f7 |
|
|
|
1d434f7 |
* **INSTALL_URL**
|
|
|
1d434f7 |
|
|
|
1d434f7 |
Used to specify the golang application import URL of the main package (i.e. usually something like github.com/someorg/somerepo/subfolder). Necessary if the main package is not in the root folder of the repository.
|