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

Remote Containers Extension incompatible with Docker-Compose v2.9 #7047

Closed
bigtallcampbell opened this issue Aug 10, 2022 · 5 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded
Milestone

Comments

@bigtallcampbell
Copy link

bigtallcampbell commented Aug 10, 2022

  • VSCode Version: 1.7.0
  • Local OS Version: Windows 11
  • Remote OS Version: Ubuntu 20.04
  • Remote Extension/Connection Type: Containers
  • docker-compose --version: 2.9

VSCode Remote Containers extension is using the wrong container name when being built from docker-compose (note the -app versus _app). I believe this is from a breaking change in docker-compose (compose-spec/compose-go#294)

Steps to Reproduce:

  1. Install docker-compose v2.9
    sudo curl -L "https://github.com/docker/compose/releases/download/2.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    sudo chmod 755 $DESTINATION
  2. Clone https://github.com/bigtallcampbell/devcontainertest
  3. Build Dev Container
  4. DevContainer will fail to build

Docker images result:
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
devcontainertest_devcontainer-app latest 598b155302bc 4 minutes ago 524MB
dev_container_feature_content_temp latest 20d4bfe8ccc9 4 minutes ago 268kB

Logs from remoteContainers (snippet):
[2022-08-10T17:56:07.280Z] => => sha256:a8da6c1c38839ff116fa3b0d3807bb0bb44515c 101.11MB / 101.11MB 1.9s
=> => extracting sha256:d7bfe07ed8476565a440c2113cc64d7c0409dba8ef761fb3 0.5s
=> => extracting sha256:4a0b6a9c72470ff5d8860f27875472d3ad0d4b19051144f2 0.3s
=> => extracting sha256:d27bf6512b10b479ce26a5fccce481830b0b356e00838901 0.2s
=> => extracting sha256:7e85935d92b53aa4a04ae997f4f06c4fbffa6b027d6dc482 0.0s
=> => extracting sha256:a8da6c1c38839ff116fa3b0d3807bb0bb44515c62c8b6846 1.9s
=> [stage-2 1/2] COPY --from=dev_containers_feature_content_source /tmp/ 0.3s
=> [stage-2 2/2] RUN cd /tmp/build-features/local-cache && chmod +x ./i 14.9s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:598b155302bc944b0cdc098e7bda851086e948c8c4db8 0.0s
=> => naming to docker.io/library/devcontainertest_devcontainer-app 0.0s
=> exporting cache 0.0s
[2022-08-10T17:56:07.280Z] => => preparing build cache for export 0.0s
[2022-08-10T17:56:07.320Z]
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
[2022-08-10T17:56:07.321Z] Stop (25758 ms): Run: docker-compose --project-name devcontainertest_devcontainer -f /home/ryan/repos/bigtallcampbell/devcontainertest/.devcontainer/docker-compose.devContainer.yml -f /tmp/docker-compose/docker-compose.devcontainer.build-1660154141562.yml build --no-cache
[2022-08-10T17:56:07.322Z] Start: Run: docker inspect --type image devcontainertest_devcontainer_app
[2022-08-10T17:56:07.348Z] Stop (26 ms): Run: docker inspect --type image devcontainertest_devcontainer_app

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Aug 10, 2022
@jowax
Copy link

jowax commented Aug 10, 2022

Looks like the same issue as in microsoft/vscode-dev-containers#1567 (comment). Think the workaround before this is fixed is to either revert to docker-compose 2.7.0 or set the container name explicitly in the compose file.

Example:

...
services:
  app:
    image: my-image # <-- Set name here
...

@chrmarti chrmarti self-assigned this Aug 11, 2022
@chrmarti chrmarti added the bug Issue identified by VS Code Team member as probable bug label Aug 11, 2022
@chrmarti chrmarti added this to the August 2022 milestone Aug 11, 2022
@chrmarti
Copy link
Contributor

This broke with Docker Compose 2.8.0. microsoft/vscode-dev-containers#1567 (comment)

Getting a fix ready for the next release.

@chrmarti chrmarti changed the title Remove Containers Extension incompatible with Docker-Compose v2.9 Remote Containers Extension incompatible with Docker-Compose v2.9 Aug 11, 2022
chrmarti added a commit to devcontainers/cli that referenced this issue Aug 11, 2022
joshspicer pushed a commit to devcontainers/cli that referenced this issue Aug 11, 2022
@chrmarti
Copy link
Contributor

Fix is in Remote-Containers 0.245.0 and 0.246.0-pre-release. Let me know if that fixes it for you, thanks!

@jowax
Copy link

jowax commented Aug 11, 2022

Just tried Remote - Containers v0.245.0 with docker-compose 2.9.0, and it seems to work. Thanks for the fast fix!

@bigtallcampbell
Copy link
Author

Same - all better now. Thank you!

@mjbvz mjbvz added the verified Verification succeeded label Aug 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants