-
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(devcontainer): use official debian base image
- Loading branch information
Showing
3 changed files
with
46 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM mcr.microsoft.com/devcontainers/base:debian | ||
|
||
USER root | ||
RUN rm -rf /bin/sh && ln -s /bin/bash /bin/sh | ||
|
||
# Create a helper for installing packages leaving no traces behind | ||
COPY <<EOF /usr/sbin/install_packages | ||
#!/bin/bash | ||
set -e | ||
set -u | ||
export DEBIAN_FRONTEND=noninteractive | ||
n=0 | ||
max=2 | ||
until [ \$n -gt \$max ]; do | ||
set +e | ||
( | ||
apt update -qq && | ||
apt install -y --no-install-recommends "\$@" | ||
) | ||
CODE=\$? | ||
set -e | ||
if [ \$CODE -eq 0 ]; then | ||
break | ||
fi | ||
if [ \$n -eq \$max ]; then | ||
exit \$CODE | ||
fi | ||
echo "apt failed, retrying" | ||
n=\$((\$n + 1)) | ||
done | ||
rm -rf /var/lib/apt/lists/{*,.*} /var/cache/apt/archives/{*,.*} | ||
EOF | ||
|
||
# Set permissions and install node | ||
RUN chmod 0755 /usr/sbin/install_packages && \ | ||
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash && \ | ||
install_packages nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.