Conversation
… Server init The CMD used `bash -lc "$BASE_CMD"`. The -l flag starts a login shell that sources /etc/profile and user profile scripts. The DevPanel base image profile scripts initialise VS Code Server, which is configured to use $APP_ROOT/.vscode as its user data directory. APP_ROOT is injected at runtime by DevPanel and is not available during a login-shell execution at build/start time, so VS Code Server falls back to its default home path (/home/www/.vscode-server). Fix: use `bash -c` (no -l). $BASE_CMD is an ENV variable available in any shell context; a login shell is not required for variable expansion. Add two assertions to docker-build-test.sh: - Static check: /home/www/.vscode-server absent from image layers - Runtime check: /home/www/.vscode-server absent in running container Co-authored-by: darrenoh <2293701+darrenoh@users.noreply.github.com> Agent-Logs-Url: https://github.com/drupalforge/deployment/sessions/229084c7-0f9a-49da-9f39-8afeee42f848
There was a problem hiding this comment.
Pull request overview
This PR adjusts the deployment image’s default startup command to avoid running a login shell, preventing DevPanel base-image profile scripts from initializing VS Code Server before APP_ROOT is injected and thereby avoiding creation of /home/www/.vscode-server.
Changes:
- Update
DockerfileCMD to usebash -cinstead ofbash -lc. - Extend
tests/docker-build-test.shto assert/home/www/.vscode-serveris absent both in a fresh container filesystem (image state) and after starting with the default CMD.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Dockerfile | Switch default CMD away from login shell and document why. |
| tests/docker-build-test.sh | Add checks ensuring .vscode-server is not present in the built image or created during default startup. |
|
@copilot apply changes based on the comments in this thread |
…not during build - Dockerfile: replace "triggered by docker build or the first container start" / "baking it into the container" with accurate language: the directory is created in the container's writable layer when a login shell runs before APP_ROOT is set (i.e. at initial container startup) - docker-build-test.sh: change "image layers" / "baked into the image" to "final image" per review feedback Co-authored-by: darrenoh <2293701+darrenoh@users.noreply.github.com> Agent-Logs-Url: https://github.com/drupalforge/deployment/sessions/3c4d7459-cd62-4db5-b12d-f3613affd28c
Applied in f2191c7 — Dockerfile comment now reads "when a login shell runs before APP_ROOT has been set (for example, at initial container startup)" and "creating that directory in the container's writable layer", and the test wording has been updated to "final image". |
|
@copilot apply changes based on the comments in this thread |
…US spelling) Consistent with the rest of the repo (US English). Fixes all occurrences in Dockerfile and tests/docker-build-test.sh. Co-authored-by: darrenoh <2293701+darrenoh@users.noreply.github.com> Agent-Logs-Url: https://github.com/drupalforge/deployment/sessions/9461a099-f6d0-43fd-a33c-2d9887eb5ab2
Done in a90ca3d — changed all instances of "initialise/initialisation/initialising" to "initialize/initialization/initializing" in both |
CMD ["/bin/bash", "-lc", "$BASE_CMD"]toCMD ["/bin/bash", "-c", "$BASE_CMD"]to stop login shell from sourcing profile scripts that create/home/www/.vscode-serverdocker builddocker-build-test.sh: verify/home/www/.vscode-serveris absent from the final imagedocker-build-test.sh: verify/home/www/.vscode-serveris absent in a running container started with the default CMD✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.