Skip to content

Commit 22eff75

Browse files
authored
ci(devcontainer): use official debian base image
1 parent e0a7569 commit 22eff75

File tree

3 files changed

+45
-13
lines changed

3 files changed

+45
-13
lines changed

.devcontainer/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM mcr.microsoft.com/devcontainers/base:debian
2+
3+
USER root
4+
RUN rm -rf /bin/sh && ln -s /bin/bash /bin/sh
5+
6+
# Create a helper for installing packages leaving no traces behind
7+
COPY <<EOF /usr/sbin/install_packages
8+
#!/bin/bash
9+
set -e
10+
set -u
11+
export DEBIAN_FRONTEND=noninteractive
12+
n=0
13+
max=2
14+
until [ \$n -gt \$max ]; do
15+
set +e
16+
(
17+
apt update -qq &&
18+
apt install -y --no-install-recommends "\$@"
19+
)
20+
CODE=\$?
21+
set -e
22+
if [ \$CODE -eq 0 ]; then
23+
break
24+
fi
25+
if [ \$n -eq \$max ]; then
26+
exit \$CODE
27+
fi
28+
echo "apt failed, retrying"
29+
n=\$((\$n + 1))
30+
done
31+
rm -rf /var/lib/apt/lists/{*,.*} /var/cache/apt/archives/{*,.*}
32+
EOF
33+
34+
# Set permissions and install node
35+
RUN chmod 0755 /usr/sbin/install_packages && \
36+
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash && \
37+
install_packages nodejs

.devcontainer/devcontainer.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "jellyfin-vue Codespace (with support for Tauri and Docker development)",
3-
"image": "node:20-slim",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
46
"features": {
57
"ghcr.io/devcontainers/features/rust:1": {
68
"profile": "default"
79
},
810
"ghcr.io/devcontainers/features/docker-in-docker:2": {
911
"installDockerComposeSwitch": false
1012
},
11-
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {},
1213
"ghcr.io/devcontainers/features/github-cli:1": {}
1314
},
1415
"forwardPorts": [3000],
@@ -20,11 +21,11 @@
2021
},
2122
"postCreateCommand": {
2223
"npm": "npm ci --no-audit",
23-
"no-yarn": "unset YARN_VERSION && rm -rf /opt/yarn*",
24-
"use-bash": "rm -rf /bin/sh && ln -s /bin/bash /bin/sh",
25-
"git-config": "git config --global core.editor 'code --wait'",
26-
"postunpack": ".devcontainer/postunpack.sh"
24+
"postunpack": "install_packages $(cat packaging/tauri/apt_packages)",
25+
"unshallow": "git fetch --unshallow"
26+
},
27+
"postAttachCommand": {
28+
"install-extensions": "cat .vscode/extensions.json | jq -r .recommendations[] | xargs -n 1 code --install-extension"
2729
},
28-
"postAttachCommand": "cat .vscode/extensions.json | jq -r .recommendations[] | xargs -n 1 code --install-extension",
2930
"hostRequirements": { "cpus": 4, "memory": "8gb" }
3031
}

.devcontainer/postunpack.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)