Create custom Docker images

3 minute readReference

CloudBees CD/RO component binaries and associated Dockerfiles are available for download to create custom Docker images.

Create custom Linux Docker images

CloudBees CD/RO releases include Docker files and component archives you can use to create your own custom images. The following table includes the Docker references for all component resources:

The links in the table below download the component versions associated with the current documentation version you are viewing: 2025.03.0.178767
CloudBees CD/RO component Dockerfile Component binaries

server

Dockerfile.server (.md5)

server.tar.gz (.md5)

agent

Dockerfile.agent (.md5)

agent.tar.gz (.md5)

web

Dockerfile.web (.md5)

web.tar.gz (.md5)

analytics

Dockerfile.analytics (.md5)

analytics.tar.gz (.md5)

repository

Dockerfile.repository (.md5)

repository.tar.gz (.md5)

tools

Dockerfile.tools (.md5)

tools.tar.gz (.md5)

If you need resources for an older supported component version, downloads are available on the CloudBees CD/RO download page.

To create your custom images:

You must have Docker Engine or Docker Desktop installed on your system before performing the steps below.
  1. For the selected component, download its Dockerfile and TAR archive from the CloudBees CD/RO download page into a local directory on your system.

  2. List the contents of the folder, and verify the required files are present:

    Command
    Response
    ls -larth
    ls -larth total 543344 -rw-r--r--@ 1 user staff 2.4K Jan 25 17:08 Dockerfile.agent -rw-r--r--@ 1 user staff 265M Jan 25 17:24 agent.tar.gz -rw-r--r--@ 1 user staff 51B Jan 25 17:24 Dockerfile.agent.md5 -rw-r--r--@ 1 user staff 47B Jan 25 17:24 agent.tar.gz.md5 drwxr-xr-x 6 user staff 192B Jan 25 17:28 . drwxr-xr-x+ 143 user staff 4.5K Jan 25 17:28 ..
  3. Validate the checksums of the .md5 files by running:

    Command
    Response
    md5sum -c *.md5
    Dockerfile.agent: OK agent.tar.gz: OK
  4. To use your custom base image, update the FROM lines in the Dockerfiles with your image path.

    • To find the default base image, you can run the following:

      Command
      Example
      grep FROM Dockerfile.<COMPONENT>
      grep FROM Dockerfile.agent FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1227.1726694542 FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1227.1726694542
  5. To build the image, in the directory with your Dockerfiles and binaries, run:

    Command
    Example
    docker build -t <IMAGE-NAME> -f Dockerfile.<COMPONENT-NAME> .
    docker build -t agent-image -f Dockerfile.agent .

    Where:

    • -t <IMAGE-NAME>: Specify the name of your image.

    • -f Dockerfile.<COMPONENT-NAME>: Specify the name of your Dockerfile.

    • .: Tells Docker to use the current directory as the build context.

      • If you are not in the directory with your Dockerfiles and binaries, you can substitute . with the directory containing these files.

Create custom Windows agent Docker images

CloudBees CD/RO releases include Docker files and component archives you can use to create your own custom images. To create your custom images:

You must have Docker Desktop installed on your system before performing the steps below.

  1. For the selected component, download its Dockerfile and TAR archive from the CloudBees CD/RO download page into a local directory on your system.

    To download the agent resources for this version (2025.03.0.178767), run the following in PowerShell:

    $BASE_URL = "https://downloads.cloudbees.com/cloudbees-cd/Release_2025.03/2025.03.0.178767/windows/dockerfiles" Invoke-WebRequest -Uri "$BASE_URL/Dockerfile.windows.agent" -OutFile "Dockerfile.windows.agent" Invoke-WebRequest -Uri "$BASE_URL/Dockerfile.windows.agent.md5" -OutFile "Dockerfile.windows.agent.md5" Invoke-WebRequest -Uri "$BASE_URL/win-agent.tar.gz" -OutFile "win-agent.tar.gz" Invoke-WebRequest -Uri "$BASE_URL/win-agent.tar.gz.md5" -OutFile "win-agent.tar.gz.md5"
  2. List the contents of the folder, and verify the required files are present:

    PS Command
    Response
    Get-ChildItem -Force | Sort-Object LastWriteTime
    Get-ChildItem -Force | Sort-Object LastWriteTime Directory: C:\path\to\folder Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 1/22/2025 5:08 PM 2.4KB Dockerfile.agent -a---- 1/22/2025 5:24 PM 265MB agent.tar.gz -a---- 1/22/2025 5:24 PM 51B Dockerfile.agent.md5 -a---- 1/22/2025 5:24 PM 47B agent.tar.gz.md5 d----- 1/22/2025 5:28 PM . d----- 1/22/2025 5:28 PM ..
  3. Validate the checksums of the .md5 files:

    1. Assign the following variables:

      $dockerFile = "C:\path\to\Dockerfile.windows.agent" $dockerFile_md5 = "C:\path\to\Dockerfile.windows.agent.md5" $archiveFile = "C:\path\to\win-agent.tar.gz" $archiveFile_md5 = "C:\path\to\win-agent.tar.gz.md5"
    2. Run the following to get the checksum from each resource:

      $dockerFileHash = (Get-FileHash $dockerFile -Algorithm MD5).Hash.ToLower() $dockerFile_md5Hash = (Get-Content $dockerFile_md5).Split(" ")[0].Trim() $archiveFileHash = (Get-FileHash $archiveFile -Algorithm MD5).Hash.ToLower() $archiveFile_md5Hash = (Get-Content $archiveFile_md5).Split(" ")[0].Trim()
    3. Run the following to compare the checksums:

      PS Command
      Response
      $dockerFileHash -ieq $dockerFile_md5Hash; $archiveFileHash -ieq $archiveFile_md5Hash
      $dockerFileHash -ieq $dockerFile_md5Hash; $archiveFileHash -ieq $archiveFile_md5Hash True True
  4. To use your custom base image, update the FROM lines in the Dockerfiles with your image path.

    Windows has specific image requirements based on your Windows version. for more information, refer to the Windows Server DockerHub documentation.
    • To find the default base image, you can run the following in Powershell:

      PS Command
      Example
      Select-String "FROM" -Path Dockerfile.<COMPONENT> -CaseSensitive
      Select-String "FROM" -Path Dockerfile.windows.agent -CaseSensitive FROM mcr.microsoft.com/windows/servercore:ltsc2022 FROM mcr.microsoft.com/windows/servercore:ltsc2022
  5. To build the image, in the directory with your Dockerfiles and binaries, run:

    Docker Command
    Example
    docker build -t <IMAGE-NAME> -f Dockerfile.<COMPONENT-NAME> <PATH-TO-TAR-ARCHIVE-FOLDER>
    docker build -t cbflow-agent -f Dockerfile.windows.agent .

    Where:

    • -t <IMAGE-NAME>: Specify the name of your image.

    • -f Dockerfile.<COMPONENT-NAME>: Specify the name of your Dockerfile.

    • .: Tells Docker to use the current directory as the build context.

      • If you are not in the directory with your Dockerfiles and binaries, you can substitute . with the directory containing these files.