Skip to content

Commit

Permalink
squash layers
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Mar 2, 2024
1 parent 1934936 commit 53cab8d
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM ubuntu:jammy
FROM ubuntu:jammy AS base_image

ENV PATH="/root/bin:/opt/.cargo/bin:${PATH}"
ENV DEBIAN_FRONTEND noninteractive
ENV CARGO_HOME="/opt/.cargo"
ENV RUSTUP_HOME="/opt/.rustup"

# Disabled for now because a bit outdated:
# add-apt-repository -y ppa:ubuntu-mozilla-security/rust-updates
FROM base_image as builder

RUN \
apt-get update && \
Expand Down Expand Up @@ -126,19 +128,12 @@ RUN \
dpkg -i quarto-1.4.550-linux-amd64.deb &&\
rm quarto-1.4.550-linux-amd64.deb

ENV CARGO_HOME="/opt/.cargo"
ENV RUSTUP_HOME="/opt/.rustup"
ENV PATH="$PATH:/opt/.cargo/bin"

RUN \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y

COPY Renviron /etc/R/Renviron.site
COPY Rprofile /etc/R/Rprofile.site

# NB: Docker says $HOME should be available but it isnt so we hardcode /root for now
ENV PATH="/root/bin:${PATH}"

# Install TinyTex + common packages and put it on the PATH
RUN R -e 'install.packages("tinytex");tinytex:::install_prebuilt("TinyTeX")' && \
rm -f TinyTeX.tar.gz && \
Expand All @@ -149,3 +144,7 @@ RUN \
rm -f /usr/bin/timedatectl &&\
rm -f /etc/ImageMagick-6/policy.xml &&\
sed -i.bak 's|-g ||g' /etc/R/Makeconf

# Squash builder image into
FROM base_image
COPY --from=builder / /

0 comments on commit 53cab8d

Please sign in to comment.