Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hokusai push fails due to docker-compose v2 image naming change #338

Closed
artsyjian opened this issue Mar 2, 2023 · 3 comments · Fixed by #347
Closed

hokusai push fails due to docker-compose v2 image naming change #338

artsyjian opened this issue Mar 2, 2023 · 3 comments · Fixed by #347
Assignees
Labels
high high importance

Comments

@artsyjian
Copy link
Contributor

artsyjian commented Mar 2, 2023

push.py expects docker-compose built image to be named hokusai_<project-name>, because that's how docker-compose v1 names it. However, this does not work with docker-compose v2. In v2, the image name is hokusai-<project-name>. The separator is a dash instead of underscore.

Because of this, users who have docker-compose v2 get this error when running hokusai registry push:

Traceback (most recent call last):
  File "hokusai/lib/command.py", line 17, in wrapper
  File "hokusai/commands/push.py", line 34, in push
  File "hokusai/lib/common.py", line 85, in shout
  File "subprocess.py", line 223, in check_output
CalledProcessError: Command 'docker tag hokusai_<FILTERED>:latest <FILTERED>.dkr.ecr.us-east-1.amazonaws.com/<FILTERED>:<FILTERED>-1122' returned non-zero exit status 1

ERROR: Error response from daemon: No such image: hokusai_<FILTERED>:latest

Possible solution: Let Hokusai check user's version of docker-compose and adjust.

@artsyjian artsyjian added the high high importance label Mar 2, 2023
@artsyjian artsyjian changed the title docker-compose v2 has changed image name separator hokusai push fails due to docker-compose v2 image naming change Mar 2, 2023
@artsyjian
Copy link
Contributor Author

Possible solution: Let Hokusai check user's version of docker-compose and adjust.

This will not always work. The image name can also be specified in Docker Compose YAML, and when specified there it takes precedence. Force, for example, does specify the image name, with an underscore, so the image name will be with an underscore, even if the image is built with Compose v2.

@artsyjian
Copy link
Contributor Author

Two alternative solutions possible:

  • Always specify image name in Compose file.
  • Always build image with COMPOSE_COMPATIBILITY=true

@artsyjian
Copy link
Contributor Author

Going with COMPOSE_COMPATIBILITY=true as it seems the most feasible.

@artsyjian artsyjian self-assigned this Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high high importance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant