Problem starting docker-compose: Problem running 'docker.compose.ps'. Exit code: 1 Invalid interpolation format for "image" option in service "dockertest": "${DOCKER_REGISTRY-}dockertest" 

I am just trying to get my head around how an entire CI/CD pipeline works with Docker, Docker Compose, TeamCity, Octopus Deploy etc. and although I have previously run Docker builds with no problems on TC, trying to run a docker compose step caused problems.

Firstly, it told me the agent wasn't compatible because of lacking docker compose. As opposed to Docker Desktop, docker the package on linux does not include compose it needs to be installed separately...but wait

I installed docker-compose from package repos and then ran the build to get the error above. I had a hunch and checked the version of the ubuntu package: 1.17. The latest version is 1.27 so as usual, the package repositories are very out of date (not sure why that happens). I thought maybe the older versions didn't correctly support the interpolation.

Surely enough, after downloading the latest 1.27 and modifying the symlink to point to the new one, the build ran correctly.

Note that I added an environment variable to match DOCKER_REGISTRY, which is added by default into Visual Studio's docker-compose.yml file. In our case, we have an Azure registry, so I just it set it to that name and it was happy!