Problem
When starting Terraform Enterprise using Flexible Deployment Options (FDO) with Docker, you may encounter the following warning after running docker compose up:
$ docker compose up --detach WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
The compose file is taken from the Mounted disk installation documentation. This variable is used in the configuration as shown below.
TFE_DISK_CACHE_VOLUME_NAME: "${COMPOSE_PROJECT_NAME}_terraform-enterprise-cache"Although Terraform Enterprise starts and you can log in, runs are not executed.
Prerequisites
- You are using Terraform Enterprise FDO with Docker.
Cause
This issue occurs when the installed version of Docker Compose is too old to correctly handle the COMPOSE_PROJECT_NAME variable. You can verify your version by running the docker info command and checking the compose plugin version.
An outdated version will appear similar to the following output.
Client:
Docker Engine - Community
Version: 24.0.5
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.11.2
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.6.0
Path: /usr/libexec/docker/cli-plugins/docker-compose
scan: Docker Scan (Docker Inc.)
Version: v0.23.0
Path: /usr/libexec/docker/cli-plugins/docker-scanSolutions
Solution 1: Upgrade Docker Compose
Upgrade the Docker Compose software to version 2.21.0 or higher.
After upgrading, the output of docker info should show the updated version.
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.11.2
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.21.0
Path: /usr/libexec/docker/cli-plugins/docker-composeOutcome
After upgrading Docker Compose, the Terraform Enterprise environment should start without the warning.
$ docker compose up --detach [+] Running 2/2 ✔ Network terraform-enterprise_default Created 0.1s ✔ Container terraform-enterprise-tfe-1 Started
Additional Information
- For installation instructions, refer to the Terraform Enterprise Flexible Deployment Options for Docker documentation.
- For more details on updating your environment, see the official Docker Compose installation documentation.