Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7b0b649

Browse files
authored
fix(.devcontainer): start docker and install devcontainer CLI (#18621)
This change starts the Docker daemon in the devcontainer and install `@devcontainers/cli`.
1 parent 7387905 commit 7b0b649

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@
5656
// See: https://github.com/devcontainers/spec/issues/132
5757
"source=${localEnv:HOME},target=/mnt/home/coder,type=bind,readonly"
5858
],
59-
"postCreateCommand": "./.devcontainer/postCreateCommand.sh"
59+
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",
60+
"postStartCommand": "sudo service docker start"
6061
}

.devcontainer/postCreateCommand.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/sh
22

3+
install_devcontainer_cli() {
4+
npm install -g @devcontainers/cli
5+
}
6+
37
install_ssh_config() {
48
echo "🔑 Installing SSH configuration..."
59
rsync -a /mnt/home/coder/.ssh/ ~/.ssh/
@@ -49,6 +53,7 @@ personalize() {
4953
fi
5054
}
5155

56+
install_devcontainer_cli
5257
install_ssh_config
5358
install_dotfiles
5459
personalize

0 commit comments

Comments
 (0)