* chore: make /assets a static volume for dev container * chore: fix create-dirs script to point to /assets
53 lines
2.3 KiB
Docker
53 lines
2.3 KiB
Docker
FROM ghcr.io/ietf-tools/datatracker-app-base:latest
|
|
LABEL maintainer="IETF Tools Team <tools-discuss@ietf.org>"
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Copy library scripts to execute
|
|
ADD https://raw.githubusercontent.com/microsoft/vscode-dev-containers/v0.236.0/containers/python-3/.devcontainer/library-scripts/common-debian.sh /tmp/library-scripts/
|
|
ADD https://raw.githubusercontent.com/microsoft/vscode-dev-containers/v0.236.0/containers/python-3/.devcontainer/library-scripts/python-debian.sh /tmp/library-scripts/
|
|
ADD https://raw.githubusercontent.com/microsoft/vscode-dev-containers/v0.236.0/containers/python-3/.devcontainer/library-scripts/meta.env /tmp/library-scripts/
|
|
|
|
# [Option] Install zsh
|
|
ARG INSTALL_ZSH="true"
|
|
# [Option] Upgrade OS packages to their latest versions
|
|
ARG UPGRADE_PACKAGES="true"
|
|
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
|
|
ARG USERNAME=dev
|
|
ARG USER_UID=1000
|
|
ARG USER_GID=$USER_UID
|
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
# Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131
|
|
&& apt-get purge -y imagemagick imagemagick-6-common \
|
|
# Install common packages, non-root user
|
|
&& bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true"
|
|
|
|
# Setup default python tools in a venv via pipx to avoid conflicts
|
|
ENV PIPX_HOME=/usr/local/py-utils \
|
|
PIPX_BIN_DIR=/usr/local/py-utils/bin
|
|
ENV PATH=${PATH}:${PIPX_BIN_DIR}
|
|
RUN bash /tmp/library-scripts/python-debian.sh "none" "/usr/local" "${PIPX_HOME}" "${USERNAME}"
|
|
|
|
# Remove library scripts for final image
|
|
RUN rm -rf /tmp/library-scripts
|
|
|
|
# Copy the startup file
|
|
COPY docker/scripts/app-init.sh /docker-init.sh
|
|
RUN sed -i 's/\r$//' /docker-init.sh && \
|
|
chmod +x /docker-init.sh
|
|
|
|
# Fix user UID / GID to match host
|
|
RUN groupmod --gid $USER_GID $USERNAME \
|
|
&& usermod --uid $USER_UID --gid $USER_GID $USERNAME \
|
|
&& chown -R $USER_UID:$USER_GID /home/$USERNAME \
|
|
|| exit 0
|
|
|
|
USER dev:dev
|
|
|
|
# Install current datatracker python dependencies
|
|
COPY requirements.txt /tmp/pip-tmp/
|
|
RUN pip3 --disable-pip-version-check --no-cache-dir install --user --no-warn-script-location -r /tmp/pip-tmp/requirements.txt
|
|
RUN sudo rm -rf /tmp/pip-tmp
|
|
|
|
VOLUME [ "/assets" ]
|