Skip to content

Commit

Permalink
Merge pull request #57 from BerriJ/noble
Browse files Browse the repository at this point in the history
Noble
  • Loading branch information
BerriJ authored Oct 4, 2024
2 parents aaec00c + 0e1cd2a commit 44f6476
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
29 changes: 17 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
FROM ubuntu:jammy@sha256:58b87898e82351c6cf9cf5b9f3c20257bb9e2dcf33af051e12ce532d7f94e3fe
FROM ubuntu:noble@sha256:b359f1067efa76f37863778f7b6d0e8d911e3ee8efa807ad01fbf5dc1ef9006b


SHELL ["/bin/bash", "-c"]

ENV DISPLAY=:0 \
TZ=Europe/Berlin

ARG USERNAME=vscode
ARG USERNAME=ubuntu
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
# Add ubuntu user to ubuntu and staff groups
RUN usermod -a -G staff,$USERNAME $USERNAME

# Create folders to mount extensions
RUN mkdir -p /home/$USERNAME/.vscode-server/extensions \
Expand All @@ -36,6 +35,7 @@ RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula sele
ccache \
gfortran \
netbase \
cargo \
zip \
unzip \
xclip \
Expand Down Expand Up @@ -116,13 +116,13 @@ 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/*

# Set PATH for user installed python packages
ENV PATH="/home/vscode/.local/bin:${PATH}"
ENV PATH="/home/${USERNAME}/.local/bin:${PATH}"

# Install Latex
COPY install_scripts/install_latex.sh /tmp/install_latex.sh
Expand All @@ -138,22 +138,22 @@ RUN chmod +x /tmp/install_latex.sh &&\
$(grep -o '^[^#]*' /tmp/latex_packages.txt | tr '\n' ' ') \
&& chown --recursive $USERNAME:$USERNAME /usr/local/texlive

# Set Latex Path
# Set Latex Paths
ENV PATH="/usr/local/texlive/bin/x86_64-linux:${PATH}"

# Install R
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-10-01
# 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__/noble/2024-10-01

COPY install_scripts/install_r.sh /tmp/install_r.sh
COPY package_lists/r_packages.txt /tmp/r_packages.txt
COPY package_lists/r_packages_github.txt /tmp/r_packages_github.txt

RUN chmod +x /tmp/install_r.sh &&\
/tmp/install_r.sh
/tmp/install_r.sh

COPY --chown=$USERNAME .misc/.zshrc /home/$USERNAME/.

Expand All @@ -165,11 +165,16 @@ COPY --chown=$USERNAME .misc/Makevars /home/$USERNAME/.R/.
RUN mkdir /home/$USERNAME/.ccache && chown -R $USERNAME /home/$USERNAME/.ccache
COPY --chown=$USERNAME .misc/ccache.conf /home/$USERNAME/.ccache/.

ENV PATH="/root/.local/bin:${PATH}"
RUN chown -R $USERNAME /root/.local/bin
RUN chown -R $USERNAME /usr/local/lib
RUN chown -R $USERNAME /usr/local/include

# Switch to non-root user
USER $USERNAME

RUN cargo install tex-fmt
ENV PATH="/home/ubuntu/.cargo/bin:${PATH}"

# Start zsh
CMD [ "zsh" ]
19 changes: 11 additions & 8 deletions install_scripts/install_r.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#!/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
apt update -qq
# install two helper packages we need
apt install -y --no-install-recommends software-properties-common dirmngr
# add the signing key (by Michael Rutter) for these repos
# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# Fingerprint: E298A3A825C0D65DFD57CBB651716619E084DAB9
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# add the R 4.X repo from CRAN
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu noble-cran40/"

apt-get update

Expand All @@ -16,7 +21,6 @@ RUNDEPS="ca-certificates \
libxml2-dev \
vim-tiny \
wget \
dirmngr \
libmagick++-dev \
libpoppler-cpp-dev \
libudunits2-dev \
Expand All @@ -28,7 +32,6 @@ RUNDEPS="ca-certificates \
libfribidi-dev \
curl \
libgit2-dev \
pandoc-citeproc \
qpdf"

# Install R amd dependencies
Expand Down Expand Up @@ -59,7 +62,7 @@ echo 'options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRv
Rscript -e "install.packages('docopt', repos= '$R_REPOS')"

# Install alternative r console
pip3 install -U --no-cache-dir radian
pip3 install --user --no-cache-dir --break-system-packages radian

# R packages on RSPM
install2.r --error --skipinstalled --ncpus 32 \
Expand All @@ -70,7 +73,7 @@ installGithub.r \
$(grep -o '^[^#]*' tmp/r_packages_github.txt | tr '\n' ' ')

# Miniconda for Refinitiv and resp. python dependenies
R -e "Refinitiv::install_eikon()"
# R -e "Refinitiv::install_eikon()"

chown --recursive $USERNAME:$USERNAME /usr/local/lib/R/site-library

Expand Down

0 comments on commit 44f6476

Please sign in to comment.