-
Notifications
You must be signed in to change notification settings - Fork 287
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
Clone repository in container volume with Docker Compose fails due to permissions for non-existant folder #5388
Comments
//cc: @bamurtaugh as well |
I'm still experiencing this issue (even after adding the imaginary |
Appreciate the workaround @Chuxel . That workaround works for me, macOS, non-root user vscode. I'll watch the repo for updates. 🙌 |
@Chuxel This workaround does not seem to work anymore on MacOS (we was using it since a long time) with latest version of Docker Desktop (4.12.0). Have been able to repro using both 0.251.0 and prerelease v0.252.0 on a from scratch repo using nodejs-postgres devcontainer definition.
I also tried with Docker Desktop For Linux (Ubuntu) with exactly the same symptom. The only diff is there is no way to put a fake path (it prevent Docker Desktop to actually start) so I have tried with / in File Sharing settings. For now the only workaround that works for me was to remove these lines from docker-compose.yml def (since we are always cloning in a container volume and not using Open Folder in Container) :
But I think the root cause should be address. |
I also am running into this since upgrading to 4.12. With 4.11 I was able to remove the volumes from the docker-compose.yml but with 4.12 that does not work.
|
same error on macOS with node-postgres. any update? |
A more robust workaround is to change the bind mount in the volumes:
- ../..:/workspaces:cached and the workspace folder in the "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", This way the extension overwrites the mount point at |
thank you @chrmarti! works well on MacOS |
@bamurtaugh @samruddhikhandale @joshspicer We may want to update our Docker Compose templates to mirror this since I think it's also the Codespaces default behavior, so we'd be more consistent too. |
Aply the fix suggested in microsoft/vscode-remote-release#5388 (comment)
Apply the fix suggested in microsoft/vscode-remote-release#5388 (comment)
This is the [out of the box VS Code devcontainer that bundles Python, Node and PostgreSQL][1]. The only amendment was to apply [the bug fix for a bug with the docker compose volume][2], that prevented the container from starting. [1]: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/python-3-postgres [2]: microsoft/vscode-remote-release#5388 (comment)
This is the [out of the box VS Code devcontainer that bundles Python, Node and PostgreSQL][1]. The only amendment was to apply [the bug fix for a bug with the docker compose volume][2], that prevented the container from starting. [1]: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/python-3-postgres [2]: microsoft/vscode-remote-release#5388 (comment)
* Add Python devcontainer with Node & PostgreSQL This is the [out of the box VS Code devcontainer that bundles Python, Node and PostgreSQL][1]. The only amendment was to apply [the bug fix for a bug with the docker compose volume][2], that prevented the container from starting. [1]: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/python-3-postgres [2]: microsoft/vscode-remote-release#5388 (comment) * Add VS Code PostgreSQL extension on devcontainer We use [the most popular VS Code PostgreSQL extension][3]. [3]: https://marketplace.visualstudio.com/items?itemName=ckolkman.vscode-postgres * Install psql on devcontainer [psql][4] is the command line client for PostgreSQL. [4]: https://www.postgresql.org/docs/current/app-psql.html * Add shellcheck extension on devcontainer * Add Java to devcontainer (needed for Liquibase) Java is installed on the devcontainer as a [devcontainer feature][5], which makes the installation very easy. [5]: https://containers.dev/features * Install Liquibase on devcontainer [Liquibase][6] is an open source tool for versioning database changes. [6]: https://www.liquibase.org/ * Create transaction database table via liquibase * Seed database with 3 initial transactions * Add liquibase update script * Add script to create database if it does not exist See https://stackoverflow.com/a/18389184 * Create & populate database on devcontainer startup Using the [devcontainer postcreate command][7] for this. [7]: https://containers.dev/implementors/json_reference/#lifecycle-scripts * Run Liquibase in headless mode We run it in headless mode because we are invoking it from a script which gets automatically invoked by the devcontainer as a [postcreate command][8]. [8]: https://containers.dev/implementors/json_reference/#lifecycle-scripts
@chrmarti do you happen to have a workaround for when you pick a different workspaceFolder? In our case, we have this config:
But I cannot get Clone in Volume to work with this setup and the only examples I see are for Does workspaceFolder not work for Clone in Container volume? |
I was able to get it work by doing this (not the cleanest method, honestly would prefer if workspaceFolder worked):
Unfortunately I could not find a way to use workspaceFolder directly for both Mounted and In Volume methods. The In Volume method would always fail if I specified /var/www/html as the workspaceFolder. I do think that's a bug tho? |
This was a workaround but this can not be the end solution :) thx for your hard work |
Any updates on this? |
I tried OrbStack instead of Docker Desktop on macos and it solved the issue for some reason. |
Version: 1.59.0-insider
Commit: e8a59bc6f920e731b47f0bc72263e82aba8b796e
Date: 2021-07-22T05:13:00.851Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Darwin x64 20.5.0
Steps to Reproduce:
/workspace
folder.Expected: Docker Compose-based dev containers start
Actual: Errors. What appears to be happening is the existing "workspace folder" mount point in the docker compose file is still there, but ends up using the path inside the container instead... which is not allowed by Docker so a permissions error appears.
Earlier in the log file you can see this path in the output:
In this case the docker-compose.yaml file includes the following:
...which is required for the non-volume case.
If you add
/workspace
to your share config, it works even though the folder doesn't exist.The text was updated successfully, but these errors were encountered: