From 1832ece8a9a992e20d8a211472b114290ffcbe4a Mon Sep 17 00:00:00 2001 From: Toshihiko SHIMOKAWA Date: Wed, 24 Jun 2026 14:58:31 +0900 Subject: [PATCH] Restore postCreateContainer.sh execution on container init Revert the setup-script lifecycle hook from onCreateCommand back to postCreateCommand (changed in #111). The script bin/.postCreateContainer.sh and all of its dependencies (lib/.support/makefile, bashrc_additions.sh, atcoder-cli-nodejs config) live on host bind mounts declared in docker-compose.yml. onCreateCommand runs early in the creation lifecycle, before the workspace/bind mounts are available, so the script could not be found and never ran on a fresh clone. It also runs without a TTY, so the interactive aclogin prompt was skipped and its output was hidden in the creation log. postCreateCommand runs after the mounts are ready and provides an interactive terminal, restoring the intended setup behavior. A comment is added to prevent regressing to onCreateCommand. --- .devcontainer/devcontainer.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e88e85d..c23509f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -92,10 +92,13 @@ // Uncomment the next line if you want to keep your containers running after VS Code shuts down. // "shutdownAction": "none", - // Run commands when the container is created for the first time. - // Use onCreateCommand instead of postCreateCommand for better performance - // since the initialization only needs to run once. - "onCreateCommand": "bin/.postCreateContainer.sh 2>&1 | tee /tmp/postCreateContainer.log" + // Run commands after the container is created. + // Use postCreateCommand (not onCreateCommand): the setup script and all its + // dependencies live on host bind mounts (see docker-compose.yml). onCreateCommand + // runs before the workspace/bind mounts are available, so the script would not be + // found. postCreateCommand runs after mounts are ready and provides a TTY for the + // interactive aclogin prompt. + "postCreateCommand": "bin/.postCreateContainer.sh 2>&1 | tee /tmp/postCreateContainer.log" // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. // "remoteUser": "vscode"