Skip to content

Building a Docker product image locally

Build a Docker image of our products using the build tools found in our Docker Builds repo and a local copy of a product .zip archive.

Cloning a build repository

To open a terminal and clone the pingidentity-docker-builds repo, enter:

git clone https://github.com/pingidentity/pingidentity-docker-builds.git

Downloading a product .zip archive

  1. Go to Product Downloads and download the product you'd like to use to build a Docker image.

    Ensure you download the product distribution .zip archive and not the Windows installer.

  2. When the download has finished, rename it to product.zip:

    mv pingfederate-10.1.0.zip product.zip
    
  3. Move product.zip to the Build Directory.

    In the pingidentity-docker-builds repo directory for each product. Move the product.zip file to the <product>/tmp directory, where /<product> is the name of one of our available products. For example:

    mv ~/Downloads/product.zip \
       ~/pingidentity/devops/pingidentity-docker-builds/pingfederate/tmp
    

Building the Docker image

Before building the image, display the versions.json file in the product directory. You must specify a valid version for the build script. Because you're providing the product .zip archive, it doesn't really matter which version you select as long as it's valid. For example, you can see that 10.1.0 is a valid product version for PingFederate.

product build versions

  1. Go to the base of the pingidentity-docker-builds repo. For example:

    cd ~/pingidentity/devops/pingidentity-docker-builds
    
  2. To build the image, run the serial_build.sh script with the appropriate options. For example:

    ./ci_scripts/serial_build.sh \
        -p pingfederate \
        -v 10.1 \
        -s alpine \
        -j az11
    

    It's important that you build from the base of the repo as shown in the example.

    When the build is completed, the product and base images are displayed. For example:

    Local Build Image List

    Our Docker images are built using common foundational layers that the product layer will need, such as Java virtual machine (JVM), pingcommon, and pingdatacommon.

    Because it's unlikely that you'll have the foundational layers locally, build the product using the serial_build.sh script. Going forward, if you want to use the same foundational layers, you need only run the build_product.sh script to build the product layer.

    You must specify the appropriate options when you run serial_build.sh. For PingFederate, the options might look like this:

    • -p (Product): pingfederate
    • -v (Version): 10.1.0
      • Note: this is the version retrieved from the versions.json file
    • -s (Shim): alpine
    • -j (Java): az11

Re-tagging the local image

To change the tag of the created image and push it to your own Docker registry, use the docker tag command:

docker tag [image id] \
   [Docker Registry]/[Organization]/[Image Name]:[tag]

For example:

docker tag a379dffedf13 \
    gcp.io/pingidentity/pingfederate:localbuild

Local Build Image List