This guide shows you how to download and install Dynatrace Configuration as Code via Monaco (the Dynatrace Monaco CLI).
A container image of the Dynatrace Monaco CLI is available to simplify usage in CI/CD pipelines.
Images are available 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, commands run in the container image are running from a /monaco
working directory. If you map your configurations into the container as a Docker volume, it's easiest to map the volume to this directory.
In the following example, we validate a project contained in /your/path/to/project
with a manifest.yaml
reading the deployment access token from an API_TOKEN
variable.
docker run \--env API_TOKEN=XXX \--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 entrypoint, so any inputs are passed directly to it.
However, some CI/CD tools (for example, GitLab CI/CD) need a regular shell as entrypoint. To make the container image work with these tools, you need to overwrite the entrypoint with 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 can be downloaded from the GitHub release page.
To verify the signature of a given version
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
Execute the monaco
command to try out the downloaded CLI.
> monacoTool used to deploy dynatrace configurations via the cliExamples:Deploy configuration defined in a manifestmonaco deploy service.yamlDeploy a specific environment within an manifestmonaco deploy service.yaml -e devUsage:monaco <command> [flags]monaco [command]Available Commands:completion Generate the autocompletion script for the specified shellconvert Convert v1 monaco configuration into v2 formatdelete Delete configurations defined in delete.yaml from the environments defined in the manifestdeploy Deploy configurations to Dynatrace environmentsdownload Download configuration from Dynatracegenerate Generate offers several sub-commands to generate files - take a look at the sub-commands for usagehelp Help about any commandversion Prints out the version of the monaco cliFlags:-h, --help help for monaco--support-archive Create support archive-v, --verbose Enable debug loggingUse "monaco [command] --help" for more information about a command.