A container image of the Dynatrace Monaco CLI is available to simplify usage in CI/CD pipelines.
The images are available for download via Docker Hub:
docker pull dynatrace/dynatrace-configuration-as-code:latest
You can use the image directly with the CLI commands or as a CI container with a monaco executable available inside.
By default, the commands in the container image are run from a /monaco working directory.
To map the volume to this directory, we recommend configuring it as a Docker volume in the container.
In the following example, we validate a project located at /your/path/to/project using a manifest.yaml file that reads the deployment platform token from the PLATFORM_TOKEN variable.
docker run \--env PLATFORM_TOKEN=”your Dynatrace platform-token” \--mount type=bind,src="/your/path/to/project",target=/monaco \dynatrace/dynatrace-configuration-as-code:latest deploy -d manifest.yaml
The container image uses the monaco executable as its entry point, so any inputs are passed directly to it.
However, some CI/CD tools, for example, GitLab CI/CD, need a regular shell as an entry point.
To make the container image work with these tools, you need to set the entry point to sh.
GitLab CI/CD
For details on how to use the image with GitLab CI/CD, follow the Override the entrypoint of an image GitLab documentation.
docker run
For general information on overwriting container entrypoints when using docker run, see the Docker documentation.
Dynatrace Monaco CLI version 2.2.0+
The container image is signed to allow you to verify its authenticity.
You can verify the signature using cosign and the cosign.pub key that you can download from the GitHub release page.
To verify the signature of a given version, follow these steps:
Install the applicable version of cosign for your operating system, following the installation instructions.
Download the cosign.pub public key from the GitHub release page of the version you wish to verify.
Verify the container image of the version you wish to check:
cosign verify --key cosign.pub dynatrace/dynatrace-configuration-as-code:[VERSION]
For example, to verify version 2.2.0:
cosign verify --key cosign.pub dynatrace/dynatrace-configuration-as-code:2.2.0
Learn about the following: