Azure Docker Guide

Here’s a guide to using Terraspace, Docker and Azure.


To use Cloud provider with Terraspace and Docker container you should mount the credentials.

docker run --rm -ti -v $HOME/.azure:/root/.azure boltops/terraspace

Editing Files

It is useful to be able to edit files with an text editor in your normal OS. You can do this by mounting a folder from your current host to a volume. Here an example that mounts the current working directory to the /work folder within the Docker container.

docker run --rm -ti -v $HOME/.azure:/root/.azure -v `pwd`:/work boltops/terraspace

Env Variables

Using env files is also handy. Here’s an example dev.env file.


And how to use the env file.

docker run --rm -ti -v $HOME/.azure:/root/.azure -v `pwd`:/work --env-file dev.env boltops/terraspace

Test Terraspace

Once you’ve started and are inside a container, you can start trying out terraspace.

terraspace new project -p azurerm infra --examples
cd infra
terraspace up demo -y
terraspace down demo -y

For a more detailed Learn Guide check out Azure Learn Guide.

More tools: