Docker Build Instructions
One of the easiest ways to build ShellB3 and reduce the chance of portability problems is to build on a docker container with as few dependencies installed as possible. The following sections provide various instructions creating a docker container, installing ShellB3 build dependencies, building a ShellB3 trim, and creating a ShellB3 distributable tarball. The instructions assume you already have Docker installed on a host machine and assume that portability is a priority.
Build for CentOS 6 Target
- Clone this repository to the Docker host (your local machine, a server, etc.) and the branch you wish to use:
git clone https://gitlab.ssec.wisc.edu/rayg/ShellB3.git
git checkout -t origin/my_branch
- Create the docker image to be used for future ShellB3 builds (only done once):
cd ShellB3/docker_shellb3
docker build -t shellb3_centos6 .
- Create a docker container and build ShellB3:
docker run --rm -w /host/ShellB3 --name shellb3_centos6_build -v /path/to/ShellB3:/host shellb3_centos6 ./shallbethree.sh mk_polar2grid bin_dist clean
Where /path/to/ShellB3
is the absolute path to the ShellB3 repository you cloned in Step 1. In this example mk_polar2grid
is the ShellB3 trim being built, this can be changed to whatever you'd like. The clean
command should be included if you plan to build for multiple operating systems (other docker images) so that the previous build is removed from the working directory. The final tarball generated with be in /path/to/ShellB3
You can also replace mk_polar2grid bin_dist clean
with any shallbethree.sh
arguments. Note that each call to docker run
will create a new docker container that will automatically be deleted with the --rm
argument.
Build for CentOS 6 Target - GCC 7
Currently in the geo2grid
branch the docker image made from the above instructions includes the gcc 7 compiler, but it must be sourced specially. This branch has also been tested with multiple workers when processing Make files.
docker run --rm -w /host/ShellB3 -h "geo2grid_build" -e MAKEFLAGS='-j8' --name shellb3_centos6_build -v /data/docker_volume/repos/git/ShellB3:/host shellb3_centos6_gcc7 scl enable devtoolset-7 "./copied_mount.sh mk_polar2grid bin_dist"
This method of calling ShellB3 building also uses a new copied_mount.sh
script to link source tarballs and build directories from the host machine to the docker container to avoid file system and timing errors while building. The successful tarball is copied back to the host after success. A failed build is copied to the host as a build_YYYYMMDD_HHMMSS
directory.