Building a Docker Image for Codebeamer
|
|
PTC has moved away from providing Docker images and provides a script to create your own Docker images. Read this topic for more information.
|
This topic contains information about the necessary files and instructions for building a Docker image for Codebeamer.
Prerequisites
Before you begin, ensure you meet the following prerequisites:
Downloading the Docker Image Builder and Installing Codebeamer
2. Download the following files from this page:
◦ The docker-image-builder-<codebeamer_version>.zip file which contains the Docker script.
◦ The Linux installer. For example, download the MED-61402-CD-330_2-0-0-2_Linux.bin installer.
Place this installer in the directory that contains the extracted Docker Image Builder. This directory also contains the README.md file, the docker-compose.yml file, and the Dockerfile.
Base Image Selection
Once you have downloaded the Docker Image Builder from the
PTC Software Download page, you can select the base image.
Select your base OS image by setting the BASE_IMAGE build argument, or leave it unset to default eclipse-temurin:21-jammy
…
Build:
context:
args:
BASE_IMAGE: ${BASE_IMAGE}
…
Adding Codebeamer Version Information to the Image
Modify the following section in the docker-compose.yml file to customize image tag:
…
codebeamer-app:
image: codebeamer:TAG
…
For example:
image: codebeamer:2.2.0.0
Using custom context path
Modify the following section in the docker-compose.yml file to customize the application context path:
build:
context: .
args:
CB_CONTEXT_PATH: ${CUSTOM}
Verifying the Git Image References
To ensure you use the latest Git image references in the Builder, follow these steps:
1. Open Dockerfile in a text editor.
2. Search for the following instructions, typically located near lines 106–107:
COPY --chown=appuser:appuser --from=bitnami/git:2.49.0 /opt/bitnami/git/bin/git /usr/local/bin/git
COPY --chown=appuser:appuser --from=bitnami/git:2.49.0 /opt/bitnami/git/ /opt/bitnami/git/
If you find these instructions, replace them with the following:
COPY --chown=appuser:appuser --from=intland/git:2.49.0 /opt/bitnami/git/bin/git /usr/local/bin/git
COPY --chown=appuser:appuser --from=intland/git:2.49.0 /opt/bitnami/git/ /opt/bitnami/git/
Building the Docker Image
Enter the following command to build and start the Docker container in the directory where the docker-compose.yaml file is located:
docker-compose up -d --build
This builds the Codebeamer Docker image, creates the container, and starts the Codebeamer application.
|
|
The docker-compose.yaml file is not a production compose file. It is not recommended to use this file in production environment. The file uses only one database and does not meet the requirements of production.
|
Creating a Docker image using Git
Modify the following section in the docker-compose.yaml to create an image using Git,. The true and false options are available when creating the image using Git. The default option is false.
build:
context: .
args:
GIT_IMAGE:true|false
Accessing Codebeamer
Once the Codebeamer container is running, you can access Codebeamer by navigating to http://localhost:portnumber in a web browser, where portnumber in the URL is the number of the appropriate port.
The default port number is 8080, and hence the default address is http://localhost:8080.
Logging in to Codebeamer
You can log in to Codebeamer with the default credentials.
Configuration
You can customize the Docker Compose configuration in docker-compose.yaml file to match your specific requirements, such as ports, environment variables, and volumes.
CBX UI Environment Variables
If you prefer to use CBX UI instead of the classic one, these environment variables must be set in your docker-compose.yaml file in the environment section. You must change the CB_mail_localname and CB_applicationApi_callbackUrl variables to your Codebeamer server's FQDN. For example, examplecbserver.mycompany.com. Ensure that your Codebeamer version supports CBX UI.
…
CB_apiThrottling: false
CB_mail_localname: localhost #Change it to your FQDN (required for CBX UI and for redirects to work properly)
CB_applicationApi_callbackUrl: https://localhost #Change it to your FQDN
…
Known Issues
During the build process, you may encounter the following error message:
=> ERROR [codebeamer] https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
failed to solve: failed to load cache key: invalid response status 429
According to the BitBucket documentation, if you encounter this error, you may need to wait for about one minute and then restart the build process.