-
-
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
42 additions
and
14 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,35 @@ | ||
FROM mcr.microsoft.com/devcontainers/base:debian | ||
|
||
USER root | ||
RUN rm -rf /bin/sh && ln -s /bin/bash /bin/sh | ||
|
||
# Creates a helper for installing packages leaving no traces behind | ||
RUN cat > "/usr/sbin/install_packages" <<-'EOF' | ||
#!/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 -r /var/lib/apt/lists /var/cache/apt/archives | ||
EOF && chmod 0755 "/usr/sbin/install_packages" | ||
|
||
# Installs Node.js | ||
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo 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.