Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ [POSITIVE] [POSITIVE] onCreateCommand から postCreateCommand に戻した理由を詳細なコメントとして残している点は非常に良い実践です。bind mountの可用性とTTYの必要性という2つの重要な理由が明記されており、将来の開発者が誤って onCreateCommand に変更してしまうリスクを軽減できます。


// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
Expand Down
Loading