Skip to content

Commit

Permalink
parametrize the versions of python installed
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaffter committed Aug 29, 2024
1 parent b0f1bb3 commit d8ad47e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tools/devcontainers/sage/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM ubuntu:$imageVersion
# Set safer bash scripts
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]

# Image arguments
# List of build arguments
# https://github.com/nektos/act
ARG actVersion="0.2.65"
# https://github.com/sharkdp/hyperfine
Expand All @@ -22,24 +22,28 @@ ARG trivyVersion="0.54.1"
ARG renvVersion="1.0.0"
# https://nodejs.org/en/about/previous-releases
ARG nodeVersionMajor="20"
# https://pypi.org/project/pipenv/
ARG pipenvVersion="2024.0.1"
# https://github.com/pnpm/pnpm/releases
ARG pnpmVersion="9.9.0"
# List of Python versions separated by spaces
ARG pyenvPythonVersions="3.9.2 3.10.14 3.11.8"
# https://github.com/SonarSource/sonar-scanner-cli/releases
ARG sonarScannerVersion="5.0.1.3006"
# https://github.com/hadolint/hadolint
ARG hadolintVersion="2.12.0"
# The version of this dev container image
ARG devcontainerVersion=""
# The username of the non-root user
ARG user=vscode
ARG user="vscode"

# Set environment variables
ENV DEVCONTAINER_VERSION=${devcontainerVersion} \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8

# Install system packages
# hadolint ignore=DL3008,DL3013
# hadolint ignore=DL3008
RUN apt-get update -qq -y && export DEBIAN_FRONTEND=noninteractive \
&& apt-get install --no-install-recommends -qq -y \
ca-certificates curl git bash-completion gnupg2 lsb-release ssh sudo \
Expand Down Expand Up @@ -170,8 +174,8 @@ RUN corepack install --global "pnpm@${pnpmVersion}"
# Set up Python environments
ENV PYENV_ROOT /home/${user}/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
RUN pip install --no-cache-dir pipenv \
RUN pip install --no-cache-dir pipenv==${pipenvVersion} \
&& curl https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash - \
&& pyenv install 3.9.2 3.10.14 3.11.8
&& pyenv install ${pyenvPythonVersions}

CMD ["bash"]

0 comments on commit d8ad47e

Please sign in to comment.