Build Docker container images with RPMS from Bamboo

sig-k8s
sig-docker
#1

All work in progress branches are built in our Bamboo CI/CD environment. As soon a specific build for a branch finished successfully the “RPM Snapshot” job, Bamboo has the RPM artifacts built and persisted.

The following procedure shows you how to create a Docker image using these artifacts from Bamboo directly.

Requirements

  • git
  • Docker
  • Docker ID to load base images from DockerHub

Step 1: Check out the repository to build a Docker image

git clone https://github.com/opennms-forge/docker-horizon-core-web.git
cd docker-horizon-core-web/
git checkout -b refactor/images origin/refactor/image

Step 2: Fetch the RPMS from Bamboo from a build URL

./fetch-rpms.sh https://bamboo.opennms.org/browse/OPENNMS-ONMS2852-7

Step 3: Build the container image from the local RPMS

./build_container_image.sh

The image is created with the tag horizon-core-web:latest and also persisted in the file system in images/horizon-core-web.oci