1- # Based on image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.236.0/containers/python-3/.devcontainer/base.Dockerfile
2-
3- # [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
4- ARG VARIANT=3-bullseye
5- FROM python:${VARIANT}
1+ FROM ghcr.io/ietf-tools/datatracker-app-base:latest
62LABEL maintainer="IETF Tools Team <tools-discuss@ietf.org>"
73
84ENV DEBIAN_FRONTEND=noninteractive
@@ -17,7 +13,7 @@ ARG INSTALL_ZSH="true"
1713# [Option] Upgrade OS packages to their latest versions
1814ARG UPGRADE_PACKAGES="true"
1915# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
20- ARG USERNAME=vscode
16+ ARG USERNAME=dev
2117ARG USER_UID=1000
2218ARG USER_GID=$USER_UID
2319RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
@@ -32,145 +28,23 @@ ENV PIPX_HOME=/usr/local/py-utils \
3228ENV PATH=${PATH}:${PIPX_BIN_DIR}
3329RUN bash /tmp/library-scripts/python-debian.sh "none" "/usr/local" "${PIPX_HOME}" "${USERNAME}"
3430
35- # [Choice] Node.js version: lts, 18, 16, 14, 12, 10
36- ARG NODE_VERSION="16"
37- RUN curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash -
38- RUN apt-get install -y nodejs make gcc g++ && npm install -g yarn
39-
4031# Remove library scripts for final image
4132RUN rm -rf /tmp/library-scripts
4233
43- # Expose port 8000
44- EXPOSE 8000
45-
46- # Add Docker Source
47- RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
48- RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
49- $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
50-
51- # Install the packages we need
52- RUN apt-get update --fix-missing && apt-get install -qy \
53- apache2-utils \
54- apt-file \
55- apt-utils \
56- bash \
57- build-essential \
58- curl \
59- default-jdk \
60- docker-ce-cli \
61- enscript \
62- fish \
63- gawk \
64- gcc \
65- ghostscript \
66- git \
67- gnupg \
68- graphviz \
69- jq \
70- less \
71- libcairo2-dev \
72- libgtk2.0-0 \
73- libgtk-3-0 \
74- libnotify-dev \
75- libgconf-2-4 \
76- libgbm-dev \
77- libnss3 \
78- libxss1 \
79- libasound2 \
80- libxtst6 \
81- libmagic-dev \
82- libmariadb-dev \
83- libmemcached-tools \
84- locales \
85- mariadb-client \
86- memcached \
87- netcat \
88- nano \
89- pigz \
90- pv \
91- python3-ipython \
92- ripgrep \
93- rsync \
94- rsyslog \
95- ruby \
96- ruby-rubygems \
97- subversion \
98- unzip \
99- watchman \
100- wget \
101- xauth \
102- xvfb \
103- yang-tools \
104- zsh
105-
106- # Install kramdown-rfc2629 (ruby)
107- RUN gem install kramdown-rfc2629
108-
109- # Install chromedriver if supported
110- COPY docker/scripts/app-install-chromedriver.sh /tmp/app-install-chromedriver.sh
111- RUN sed -i 's/\r $//' /tmp/app-install-chromedriver.sh && \
112- chmod +x /tmp/app-install-chromedriver.sh
113- RUN /tmp/app-install-chromedriver.sh
114-
115- # Fix /dev/shm permissions for chromedriver
116- RUN chmod 1777 /dev/shm
117-
118- # Get rid of installation files we don't need in the image, to reduce size
119- RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
120-
121- # "fake" dbus address to prevent errors
122- # https://github.com/SeleniumHQ/docker-selenium/issues/87
123- ENV DBUS_SESSION_BUS_ADDRESS=/dev/null
124-
125- # avoid million NPM install messages
126- ENV npm_config_loglevel warn
127- # allow installing when the main user is root
128- ENV npm_config_unsafe_perm true
129- # disable NPM funding messages
130- ENV npm_config_fund false
131-
132- # Set locale to en_US.UTF-8
133- RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment && \
134- echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
135- echo "LANG=en_US.UTF-8" > /etc/locale.conf && \
136- dpkg-reconfigure locales && \
137- locale-gen en_US.UTF-8 && \
138- update-locale LC_ALL en_US.UTF-8
139- ENV LC_ALL en_US.UTF-8
140-
141- # Install idnits
142- ADD https://raw.githubusercontent.com/ietf-tools/idnits-mirror/main/idnits /usr/local/bin/
143- RUN chmod +rx /usr/local/bin/idnits
144-
145- # Turn off rsyslog kernel logging (doesn't work in Docker)
146- RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf
147-
148- # Colorize the bash shell
149- RUN sed -i 's/#force_color_prompt=/force_color_prompt=/' /root/.bashrc
150-
151- ADD https://raw.githubusercontent.com/eficode/wait-for/v2.1.3/wait-for /usr/local/bin/
152- RUN chmod +rx /usr/local/bin/wait-for
153-
15434# Copy the startup file
15535COPY docker/scripts/app-init.sh /docker-init.sh
15636RUN sed -i 's/\r $//' /docker-init.sh && \
15737 chmod +x /docker-init.sh
15838
159- # Create workspace
160- RUN mkdir -p /workspace
161- WORKDIR /workspace
162-
16339# Fix user UID / GID to match host
16440RUN groupmod --gid $USER_GID $USERNAME \
16541 && usermod --uid $USER_UID --gid $USER_GID $USERNAME \
16642 && chown -R $USER_UID:$USER_GID /home/$USERNAME \
16743 || exit 0
16844
169- USER vscode:vscode
45+ USER dev:dev
17046
17147# Install current datatracker python dependencies
17248COPY requirements.txt /tmp/pip-tmp/
17349RUN pip3 --disable-pip-version-check --no-cache-dir install --user --no-warn-script-location -r /tmp/pip-tmp/requirements.txt
17450RUN sudo rm -rf /tmp/pip-tmp
175-
176- # ENTRYPOINT [ "/docker-init.sh" ]
0 commit comments