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

update to compose-go v1.4.0 as previous version introduced breaking changes #9700

Merged
merged 2 commits into from Aug 1, 2022

Conversation

glours
Copy link
Contributor

@glours glours commented Aug 1, 2022

Signed-off-by: Guillaume Lours guillaume.lours@docker.com

What I did
Bump version of compose-go to v1.4.0 which remove the breaking changes introduced in version v1.3.0 by this PR

(not mandatory) A picture of a cute animal, if possible in relation with what you did
image

…hanges

Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
@glours glours self-assigned this Aug 1, 2022
@glours glours requested a review from a team August 1, 2022 15:03
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Copy link
Member

@nicksieger nicksieger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@glours glours merged commit 7289e87 into docker:v2 Aug 1, 2022
@Jyrno42
Copy link

Jyrno42 commented Aug 5, 2022

I am having some trouble with the updated compose version 2.9.0 where this fix should be applied.

Using the following example dockerfile to demonstrate the issue:

FROM docker:latest

RUN mkdir /app
WORKDIR /app

ENV BUILDKIT_PROGRESS=plain

RUN echo -e "\
services:\n\
  example:\n\
    build:\n\
      context: .\n\
      dockerfile: Dockerfile\n\
    command: -text="hello world"\n\
" > docker-compose.yml

RUN echo -e "\
FROM hashicorp/http-echo\n\
ENV FOO=BAR" > Dockerfile

RUN echo -e "\
docker-compose --version \n\
docker compose version \n\
docker compose build \n\
docker-compose build" > /cmd.sh && chmod +x /cmd.sh

CMD ["/cmd.sh"]

And building/running it with:

docker build -f Dockerfile . -t test-bug
docker run --rm -it --privileged -v /var/run/docker.sock:/var/run/docker.sock test-bug

I am observing the following (truncated) output:

Docker Compose version v2.9.0
Docker Compose version v2.9.0
#5 naming to docker.io/library/app-example done
#5 naming to docker.io/library/app-example done

E.g. the separator used is still -.

However when I run the same image with the COMPOSE_COMPATIBILITY=1 env variable I am seeing:

Docker Compose version v2.9.0
Docker Compose version v2.9.0
#5 naming to docker.io/library/app_example done
#5 naming to docker.io/library/app_example done

Is there something I am doing wrong?

Note: I don't think the issue is with the official docker image as I am observing a similar behavior with compose v2.9.0 on my arch linux installation.

@Jyrno42
Copy link

Jyrno42 commented Aug 5, 2022

I can also open a new issue about this if needed.

@glours
Copy link
Contributor Author

glours commented Aug 5, 2022

Hi @Jyrno42
The breaking change impacted resources such as networks, volumes, secrets and config. We keep the the - by default for the container names

@Jyrno42
Copy link

Jyrno42 commented Aug 5, 2022

Oh, OK. Thanks for the clarifications. Then I know its safe to update my scripts without fearing a revert there.

ThorgateDeveloper pushed a commit to thorgate/django-project-template that referenced this pull request Aug 5, 2022
Docker changed the behaviour of the container naming to use `-`. Originally we
believed that this change was reverted in 2.9.0 as it caused a breaking change.
But it turns out instead they reverted it only for related resources such as
networks, volumes, secrets and config.

This means that going forward the container names use dashes (`-`).

Note: Also updated the poetry wrapper image name to match this new convention.

Refs:

- https://docs.docker.com/compose/release-notes/#290
- docker/compose#9700
- docker/compose#9700 (comment)
- compose-spec/compose-go#297
- Internal ref: https://thorgate.slack.com/archives/C02AMG235/p1659433239011469

Additional changes in the PR:

- Update poetry installation command
  - ref: https://python-poetry.org/docs/master/#installing-with-the-official-installer
- Remove pypi docker compose in ci image (docker-compose now comes from inside docker image anyway)
ThorgateDeveloper pushed a commit to thorgate/django-project-template that referenced this pull request Aug 5, 2022
Docker changed the behaviour of the container naming to use `-`. Originally we
believed that this change was reverted in 2.9.0 as it caused a breaking change.
But it turns out instead they reverted it only for related resources such as
networks, volumes, secrets and config.

This means that going forward the container names use dashes (`-`).

Note: Also updated the poetry wrapper image name to match this new convention.

Refs:

- https://docs.docker.com/compose/release-notes/#290
- docker/compose#9700
- docker/compose#9700 (comment)
- compose-spec/compose-go#297
- Internal ref: https://thorgate.slack.com/archives/C02AMG235/p1659433239011469

Additional changes in the PR:

- Update poetry installation command
  - ref: https://python-poetry.org/docs/master/#installing-with-the-official-installer
- Remove pypi docker compose in ci image (docker-compose now comes from inside docker image anyway)
@glours glours deleted the bump-compose-go-1.4.0 branch January 11, 2023 14:20
IncrePrior added a commit to IncrePrior/django-project-template that referenced this pull request Nov 12, 2023
Docker changed the behaviour of the container naming to use `-`. Originally we
believed that this change was reverted in 2.9.0 as it caused a breaking change.
But it turns out instead they reverted it only for related resources such as
networks, volumes, secrets and config.

This means that going forward the container names use dashes (`-`).

Note: Also updated the poetry wrapper image name to match this new convention.

Refs:

- https://docs.docker.com/compose/release-notes/#290
- docker/compose#9700
- docker/compose#9700 (comment)
- compose-spec/compose-go#297
- Internal ref: https://thorgate.slack.com/archives/C02AMG235/p1659433239011469

Additional changes in the PR:

- Update poetry installation command
  - ref: https://python-poetry.org/docs/master/#installing-with-the-official-installer
- Remove pypi docker compose in ci image (docker-compose now comes from inside docker image anyway)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants