Giter Site home page Giter Site logo

centos-go-build's Introduction

CentOS Go Application build and packaging environment

This is an environment for building Go applications and packaging them into RPM packages for deployment.

Usage:

To use this image run the following docker command:

docker run -it --rm birchwoodlangham/centos-go-build:latest

You will be logged into the container, from here you can:

cd $GOPATH/src/birchwoodlangham.com
git clone https://oauth2:API_TOKEN@<your remote git host>/<your git project path>.git
cd <your git project path>

To manually fetch dependencies and build your go applications:

go get ./...
go build -o /path/to/output/file

To create an rpm, place the appropriate files in the expected rpmbuild directories.

Create your rpm spec file and place it in the rpmbuild/SPECS folder, then run the rpmbuild command:

rpmbuild -ba --define "_topdir $PWD/rpmbuild" ./rpmbuild/SPECS/your-specs.file.spec

This should build your RPM and place it in rpmbuild/RPMS

To copy the RPM file after you built it, from another terminal, on your host use the docker cp command:

docker cp <CONTAINER_NAME>:/root/go/src/birchwoodlangham.com/your-project-name/rpmbuild/RPMS/<your-architecture>/your-rpm-file.rpm /path/on/host

Alternatively, when you start the container, you can mount the rpmbuild folder of the container to a location on your host:

docker run -it --rm -v /path/on/host:/root/rpmbuild birchwoodlangham/centos-go-build

You will have to recreate the the rpmbuild tree structure if it doesn't exist in the host folder you have mounted to /root/rpmbuild. From inside the container:

rpmdev-setuptree

This will build the appropriate rpmbuild tree for you, and when your RPM has been built, you will be able to find it under the location you have mapped to the container's rpmbuild root folder.

Change Log

2018-03-19: Initial release

centos-go-build's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.