From 80a8a805aff96f67d9d5a42884d4464f2addeaa3 Mon Sep 17 00:00:00 2001 From: Jonathan Berrisch Date: Wed, 2 Oct 2024 10:00:00 +0200 Subject: [PATCH] Use Ubuntu 24.04 (WIP) --- Dockerfile | 19 +++++++++++-------- install_scripts/install_r.sh | 6 ++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 765f583..5fc7faf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM ubuntu:jammy@sha256:58b87898e82351c6cf9cf5b9f3c20257bb9e2dcf33af051e12ce532d7f94e3fe +FROM ubuntu:noble@sha256:b359f1067efa76f37863778f7b6d0e8d911e3ee8efa807ad01fbf5dc1ef9006b + SHELL ["/bin/bash", "-c"] @@ -10,10 +11,12 @@ ARG USER_UID=1000 ARG USER_GID=$USER_UID ARG DEBIAN_FRONTEND=noninteractive -# Add non root user -RUN groupadd --gid $USER_GID $USERNAME \ - && useradd -rm -d /home/$USERNAME -s /bin/bash -g root --uid $USER_UID --gid $USER_GID $USERNAME \ - && addgroup $USERNAME staff +# Rename ubuntu user to $USERNAME +RUN usermod -l $USERNAME ubuntu \ + # Add new group called $USERNAME + && groupadd $USERNAME \ + # Add new user $USERNAME to the groups $USERNAME and staff + && usermod -a -G staff,$USERNAME $USERNAME # Create folders to mount extensions RUN mkdir -p /home/$USERNAME/.vscode-server/extensions \ @@ -116,7 +119,7 @@ RUN apt-get update &&\ python3-dev \ python3-venv && \ # Python packages - pip3 install -U --no-cache-dir \ + pip3 install -U --no-cache-dir --break-system-packages \ $(grep -o '^[^#]*' package_lists/python_packages.txt | tr '\n' ' ') \ && apt-get autoclean -y \ && rm -rf /var/lib/apt/lists/* @@ -145,8 +148,8 @@ ENV PATH="/usr/local/texlive/bin/x86_64-linux:${PATH}" ENV R_VERSION=4.4.1 # Set RSPM snapshot see: -# https://packagemanager.posit.co/client/#/repos/cran/setup?r_environment=other&snapshot=2023-10-04&distribution=ubuntu-22.04 -ENV R_REPOS=https://packagemanager.posit.co/cran/__linux__/jammy/2024-09-18 +# https://packagemanager.posit.co/client/#/repos/cran/setup?r_environment=other&snapshot=2024-10-01&distribution=ubuntu-22.04 +ENV R_REPOS=https://packagemanager.posit.co/cran/__linux__/jammy/2024-10-01 COPY install_scripts/install_r.sh /tmp/install_r.sh COPY package_lists/r_packages.txt /tmp/r_packages.txt diff --git a/install_scripts/install_r.sh b/install_scripts/install_r.sh index f48c676..18fbe42 100644 --- a/install_scripts/install_r.sh +++ b/install_scripts/install_r.sh @@ -1,9 +1,7 @@ #!/bin/bash -echo "deb http://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/" >> /etc/apt/sources.list -gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 -gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | apt-key add - -apt-get update +echo "deb http://cloud.r-project.org/bin/linux/ubuntu noble-cran40/" >> /etc/apt/sources.list +wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc apt-get update