ci(devcontainer): improve boot time

Run postunpack.sh in postCreateCommand hook,
which can continue running in the background and in parallel
to `npm ci --no-audit` when VSCode
is already connected to the devcontainer.

The time it takes for the container to be fully ready it's the same
but the time to start coding will be much lower.
This commit is contained in:
Fernando Fernández
2023-10-26 17:41:41 +00:00
committed by GitHub
parent 1f803d4b5f
commit 0809739fa7
2 changed files with 8 additions and 5 deletions
+5 -2
View File
@@ -17,8 +17,11 @@
"onAutoForward": "notify"
}
},
"onCreateCommand": ".devcontainer/postunpack.sh",
"postCreateCommand": "npm ci --no-audit",
"onCreateCommand": "apt update -qq && apt install -y --no-install-recommends jq",
"postCreateCommand": {
"npm": "npm ci --no-audit",
"postunpack": ".devcontainer/postunpack.sh"
},
"postAttachCommand": "cat .vscode/extensions.json | jq -r .recommendations[] | xargs -n 1 code --install-extension",
"hostRequirements": { "cpus": 4, "memory": "8gb" }
}
+3 -3
View File
@@ -3,7 +3,7 @@ unset YARN_VERSION && rm -rf /opt/yarn*
rm -rf /bin/sh && ln -s /bin/bash /bin/sh
git config --global core.editor 'code --wait'
## Install dependencies
apt update -qq
apt install -y --no-install-recommends jq $(cat packaging/tauri/apt_packages)
## Install Tauri dependencies
apt install -y --no-install-recommends $(cat packaging/tauri/apt_packages)
rm -rf /var/lib/apt/lists /var/cache/apt/archives