Using Dockerfiles to Build Custom Images
Protegrity base images use the default RHEL Universal Base Image. Using Dockerfiles, you can use a base image of your choice.
To create custom image:
Download the installation package.
For more information about downloading the installation package, refer to the section Extracting the Installation Package.
Important: The dependency packages required for building the Docker images are specified in the HOW-TO-BUILD file, which is a part of the installation package. You must ensure that these dependency packages can be downloaded either from the Internet or from your internal repository.
Perform the following steps to build a Docker image for the Sample Application container.
Run the following command to extract the files from the ApplicationProtector-SAMPLE-APP_SRC_<version_number>.tgz file to a directory.
tar -C <dir> ApplicationProtector-SAMPLE-APP_SRC_<version_number>.tgz
The following files are extracted:
- APJAVA_RHUBI_SAMPLE-APP_DOCKERFILE
- APJavaSetup_Linux_x64_<version_number>.tgz
- docker-entrypoint.sh
- passwd.template
- pom.xml
- libs directory - Contains the
ApplicationProtectorJava.jarfile. - src directory - Contains the source files for the Sample Application.
Perform the following steps to create an application from the source file.
- Install Maven 3.2 or later.
- Execute the following command to build the Spring application.
mvn clean install
The
apjava-springboot-0.1.0.jaris created in the./targetdirectory.Run the following command in the directory where you have extracted the contents of the ApplicationProtector-SAMPLE-APP_SRC_<version_number>.tgz file.
docker build --build-arg BUILDER_IMAGE=<Repository location of rhel ubi 9 base image> \
--build-arg BASE_MICRO_IMAGE=<Repository location of rhel ubi 9 micro base image> \
-t <image-name>:<image-tag> -f APJAVA_RHUBI_DOCKERFILE_<version_number> .
For more information the Docker build command, refer to the Docker documentation.
For more information about tagging an image, refer to the AWS documentation.
- Run the following command to list the Sample Application container image.
docker images
- Push the Sample Application container image to your preferred Container Repository.
For more information about pushing an image to the repository, refer to the section Uploading the Images to the Container Repository.
- Repeat step 2 - 3 and 5 - 7 for creating custom images for RPProxy, KMSProxy, and Log Forwarder containers and extracting the source package of the respective component.
Each extracted source package contains the corresponding Dockerfile. The steps to create custom images using the Dockerfile are same for all the images. Step 4 is not required.
Feedback
Was this page helpful?