Fix Docker Compose v2 issues
Closed this issue · 7 comments
Details
I haven't been able to make our docker-compose specification work with Docker Compose v2.
It seems there might be an issue with the way that the Docker Compose builder builds and labels images or how it loads those images later.
Problem commandline outline:
COMPOSE_PROJECT_NAME=community inv docker.up --init
[+] Running 0/22
⠿ build Error 1.6s
⠿ web Error 1.6s
⠿ celery Error 1.6s
⠧ cache Pulling 1.6s
⠸ 8559a31e96f4 Waiting 0.2s
⠸ 85a6a5c53ff0 Waiting 0.2s
⠸ b69876b7abed Waiting 0.2s
⠸ a72d84b9df6a Waiting 0.2s
⠸ 5ce7b314b19c Waiting 0.2s
⠸ 04c4bfb0b023 Pulling fs layer 0.2s
⠿ proxito Error 1.6s
⠧ database Pulling 1.6s
⠧ nginx Pulling 1.6s
⠿ search Error 1.6s
⠦ storage Pulling 1.6s
⠸ fdf7c3c4a3fe Pulling fs layer 0.3s
⠸ 4af7314918ee Pulling fs layer 0.3s
⠸ 992a193f98f7 Pulling fs layer 0.3s
⠸ 95cf6d3796df Waiting 0.3s
⠸ 38d15d2268e2 Waiting 0.3s
⠸ f2eb043bf4aa Waiting 0.3s
⠸ f46ceb6e5389 Waiting 0.3s
Error response from daemon: pull access denied for community_server, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
There's a series of Docker Compose issues open that seem related but they all have workarounds. I'm expanding this issue once I diagnose this further.
For now, I can reproduce the error on Docker Compose v2 without the patch: After purging all images, the error persists. Applying the patch immediately fixes the issue.
See resources:
https://docs.docker.com/compose/extends/
https://docs.docker.com/compose/compose-file/build/
Issues that might be of interest:
https://github.com/docker/compose/issues/8805
https://github.com/docker/compose/issues/8538
https://github.com/docker/compose/issues/9232
What exact version of Docker compose are you using? I've been using v2 (I don't know the minor -I'm on mobile) for a while and I didn't have issues yet. Will double check on Monday
docker-compose -v
Docker Compose version v2.10.0
It's super weird, I haven't gotten to a good diagnosis of the problem yet.
The only problem that I found with v2 is the naming of the containers. In v1 it uses _
as separator and I'm v2 it uses -
. I'm using an environment variable in v2 to use the old separator
This is the setting that I have in my local environment: COMPOSE_COMPATIBILITY=true
See https://docs.docker.com/compose/cli-command-compatibility/
$ docker-compose --version
Docker Compose version 2.12.2
Yes COMPOSE_COMPATIBILITY
has fixed the issue and I think I've learned the hard way on several setups to pay attention to the _
and -
:)
Thanks @humitos and sorry for not getting back to this before and marking it fixed.
that _
and -
change.... oof... what a sad thing to change and break people's setups with :( If Open Source had an Ombudsmand, I would tell them to take up this as a clear case of violating The Developer's Right To Not Having Their Setup Broken For No Good Reason :)