Documentation

Looking for something in particular?

Import Certificates in a Docker Container Using a Dockerfile

Summary

When tests run inside a Docker container, the following error may appear:

“The floating license was not found”

This error can occur in two cases:

  1. The license is not present.
  2. The client machine or server is unable to connect to the Provar license server because the required certificates are not whitelisted.

This article explains how to resolve the error when it is caused by certificate issues in a Docker container.

Prerequisite

Download the license certificate from:

https://prod.provar.cloud/licensing/algas

Steps

Step 1: Check the Dockerfile configuration

Review the customer’s Dockerfile to confirm:

  • The operating system used in the Docker container
  • The Java distribution used, such as Corretto, OpenJDK, or another Java version

You can ask the customer to share this information from their Dockerfile.

Step 2: Locate the Java cacerts file

Find the path where the installed Java cacerts file is located. This path is needed for the keytool command.

For OpenJDK, the path is:

/usr/lib/jvm/java-11-openjdk-amd64/lib/security/cacerts

To find the correct path, run a Docker container using the same operating system and install the same Java version that is used in the customer’s Dockerfile.

Step 3: Create the keytool command

Create the keytool command using the correct certificate and cacerts paths.

Example:

keytool -import -noprompt -trustcacerts -alias myFancyAlias123 -file ${WORKSPACE}/licenseserver.crt -keystore "/usr/lib/jvm/java-11-openjdk-amd64/lib/security/cacerts" -storepass changeit

In this example:

  • ${WORKSPACE} refers to the project root directory in Docker.
  • licenseserver.crt is the certificate file name.
  • The -keystore value should be updated to match the actual cacerts path for the Java installation.

Step 4: Add the command to the Dockerfile

Add the generated keytool command to the Dockerfile.

The command should be passed between two newline characters:

\n

Step 5: Build the image and run the container

Build the Docker image and then run the Docker container.

Note

This article uses the license server certificate issue as an example. The same approach may also be used for other certificate-related issues.


Feedback

Was this article helpful for you?
Documentation library

Trying to raise a case with our support team?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top