Creating the Anjuna Docker images
The Anjuna Nitro Kubernetes Toolset consists of three components, each with its own Docker image.
Refer to Anjuna Nitro Kubernetes Toolset overview
for more information.
Before building the Docker images, you need to determine the version of your Anjuna Nitro Kubernetes Toolset and set an environment variable for it:
$ export ANJUNA_VERSION=$(grep appVersion helm-charts/anjuna-tools/Chart.yaml | cut -f2 -d" " | cut -f2 -d'"')
Create another environment variable in which to store your Docker registry URL:
$ export DOCKER_REGISTRY=[your Docker registry URL]
For example,
$ export DOCKER_REGISTRY=[account_id].dkr.ecr.[region].amazonaws.com
After you set the environment variables, you need to choose whether to use the Docker images for
the Anjuna K8s Toolset pre-built by Anjuna or build the Docker images on your own.
You may want to build the Docker images on your own when:
-
You want to control the contents of the images
-
You want to change the base image to something other than Amazon Linux 2 (to Red Hat Enterprise Linux (RHEL), for example)
If you want to use the pre-built Docker images provided by Anjuna, follow the Load the pre-built Docker images section just below.
Otherwise, follow the Build the Docker images section below. After you load or build the Docker images, you will need to push them. Follow the Push the Docker images section below.
Load the pre-built Docker images
Load the pre-built Docker images to your Docker environment:
$ docker load --input docker/tar/anjuna-device-manager.tar
$ docker load --input docker/tar/anjuna-nitro-launcher.tar
$ docker load --input docker/tar/anjuna-nitro-webhook.tar
Tag the Docker images with your Docker registry:
$ docker tag "anjuna-device-manager:${ANJUNA_VERSION}" \
"${DOCKER_REGISTRY}/anjuna-device-manager:${ANJUNA_VERSION}"
$ docker tag "anjuna-nitro-launcher:${ANJUNA_VERSION}" \
"${DOCKER_REGISTRY}/anjuna-nitro-launcher:${ANJUNA_VERSION}"
$ docker tag "anjuna-nitro-webhook:${ANJUNA_VERSION}" \
"${DOCKER_REGISTRY}/anjuna-nitro-webhook:${ANJUNA_VERSION}"
Build the Docker images
Extract the Anjuna Nitro Webhook binary:
$ tar --directory docker/specs/webhook \
--extract --strip-components 2 \
--file docker/specs/launcher/artifacts.tar \
./bin/anjuna-k8s-nitro-webhook
Extract the Anjuna Device Manager binary:
$ tar --directory docker/specs/device-manager \
--extract --strip-components 3 \
--file docker/specs/launcher/artifacts.tar \
./k8s/bin/
Build the Docker images:
$ docker build docker/specs/webhook \
--no-cache \
--file docker/specs/webhook/Dockerfile \
--tag "${DOCKER_REGISTRY}/anjuna-nitro-webhook:${ANJUNA_VERSION}"
$ docker build docker/specs/launcher \
--no-cache \
--file docker/specs/launcher/Dockerfile \
--tag "${DOCKER_REGISTRY}/anjuna-nitro-launcher:${ANJUNA_VERSION}"
$ docker build docker/specs/device-manager \
--no-cache \
--file docker/specs/device-manager/Dockerfile \
--tag "${DOCKER_REGISTRY}/anjuna-device-manager:${ANJUNA_VERSION}"
Push the Docker images
Push the Docker images to your Docker registry:
$ docker push "${DOCKER_REGISTRY}/anjuna-nitro-webhook:${ANJUNA_VERSION}"
$ docker push "${DOCKER_REGISTRY}/anjuna-nitro-launcher:${ANJUNA_VERSION}"
$ docker push "${DOCKER_REGISTRY}/anjuna-device-manager:${ANJUNA_VERSION}"
The repositories must be created in the container registry. |