|
| 1 | +FROM ubuntu:latest |
| 2 | + |
| 3 | +# Avoid warnings by switching to noninteractive |
| 4 | +ENV DEBIAN_FRONTEND=noninteractive |
| 5 | + |
| 6 | +ARG USERNAME=vscode |
| 7 | +ARG USER_UID=1000 |
| 8 | +ARG USER_GID=$USER_UID |
| 9 | +ARG INSTALL_ZSH="true" |
| 10 | + |
| 11 | +ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh" |
| 12 | +ARG COMMON_SCRIPT_SHA="dev-mode" |
| 13 | +RUN echo "APT::Acquire::Queue-Mode "access"; APT::Acquire::Retries 3; " > /etc/apt/apt.conf.d/99parallel && \ |
| 14 | + export DEBIAN_FRONTEND=noninteractive && \ |
| 15 | + apt-get update && apt-get install -y --no-install-recommends tzdata gnupg ca-certificates curl unzip apt-utils build-essential software-properties-common && \ |
| 16 | + ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ |
| 17 | + dpkg-reconfigure --frontend noninteractive tzdata && \ |
| 18 | + apt-get clean -y |
| 19 | + |
| 20 | +# Configure apt and install packages |
| 21 | +RUN apt-get update \ |
| 22 | + && apt-get -y install --no-install-recommends apt-utils dialog wget ca-certificates 2>&1 \ |
| 23 | + # |
| 24 | + # Verify git, common tools / libs installed, add/modify non-root user, optionally install zsh |
| 25 | + && wget -q -O /tmp/common-setup.sh $COMMON_SCRIPT_SOURCE \ |
| 26 | + && if [ "$COMMON_SCRIPT_SHA" != "dev-mode" ]; then echo "$COMMON_SCRIPT_SHA /tmp/common-setup.sh" | sha256sum -c - ; fi \ |
| 27 | + && /bin/bash /tmp/common-setup.sh "$INSTALL_ZSH" "$USERNAME" "$USER_UID" "$USER_GID" \ |
| 28 | + && rm /tmp/common-setup.sh |
| 29 | + |
| 30 | +RUN apt-get install -y --no-install-recommends \ |
| 31 | + texlive-full python-pygments graphviz |
| 32 | + |
| 33 | +ENV PATH=$PATH |
| 34 | + |
| 35 | +RUN apt-get autoremove -y \ |
| 36 | + && apt-get clean -y \ |
| 37 | + && rm -rf /var/lib/apt/lists/* |
| 38 | + |
| 39 | +USER ${USER_UID}:${USER_GID} |
| 40 | + |
| 41 | +# Switch back to dialog for any ad-hoc use of apt-get |
| 42 | +ENV DEBIAN_FRONTEND=dialog |
0 commit comments