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

Fail to compose down the container when the project is in the subdirectory #2633

Closed
v-mengwe opened this issue Jan 15, 2021 · 2 comments · Fixed by #2658
Closed

Fail to compose down the container when the project is in the subdirectory #2633

v-mengwe opened this issue Jan 15, 2021 · 2 comments · Fixed by #2658
Milestone

Comments

@v-mengwe
Copy link

v-mengwe commented Jan 15, 2021

OS: All
Build Version: 20210114.1

Repro Steps:

  1. Create an Express App project and open it in VS Code -> Command Palette -> Add Docker files to workspace -> Node.js -> Enter port -> Close the workspace folder.
  2. Create a new folder -> Move the Express App project into the new folder.
  3. Right click the docker-compose.yml file -> Select "Compose Up".
  4. Navigate to "Containers" view -> Right click the compose group -> Select "Compose Down".
  5. Check whether compose down the container successfully.

Expect:
Compose down the container successfully without any error.

Actual:
Fail to compose down the container with an error.
image

More Info:
This issue also reproduces for "Compose Logs/Compose Restart" commands.

@bwateratmsft
Copy link
Collaborator

Good find! The compose down / etc. commands are supposed to be using absolute paths so I'll have to look into why this is happening.

@bwateratmsft bwateratmsft self-assigned this Jan 15, 2021
@dbreshears dbreshears added this to the 1.11.0 milestone Jan 20, 2021
@bwateratmsft
Copy link
Collaborator

What's happening is basically contradictory information from compose. They use the paths for the config files, relative to cwd of the docker-compose up command execution; but they stamp the working directory as the folder containing the config files.

For example:
Compose up "NetNoSsl\docker-compose.yml" from directory: D:\Sandbox
Working dir label: D:\Sandbox\NetNoSsl
Config files label: NetNoSsl\docker-compose.yml

I don't think that this is desirable behavior; IMO the config files should always be relative to the working dir--so either working dir should be "D:\Sandbox" above, or config files should be just "docker-compose.yml".

In terms of solving the problem--I think I'll just take the filenames only from the config files label, i.e. "docker-compose.yml" instead of "NetNoSsl\docker-compose.yml". Having a working dir that doesn't directly contain the config files is probably unusual.

@bwateratmsft bwateratmsft modified the milestones: 1.11.0, 1.10.0 Jan 21, 2021
@bwateratmsft bwateratmsft removed their assignment Jan 21, 2021
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants