Skip to content

Commit

Permalink
Fix cargo install / path
Browse files Browse the repository at this point in the history
  • Loading branch information
BerriJ committed Oct 2, 2024
1 parent 9492e9b commit 2e18bb1
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -136,42 +136,43 @@ RUN chmod +x /tmp/install_latex.sh &&\
&& tlmgr option -- srcfiles 0 \
&& tlmgr install \
$(grep -o '^[^#]*' /tmp/latex_packages.txt | tr '\n' ' ') \
&& chown --recursive $USERNAME:$USERNAME /usr/local/texlive \
&& cargo install tex-fmt
&& chown --recursive $USERNAME:$USERNAME /usr/local/texlive

# Set Latex Paths
ENV PATH="/usr/local/texlive/bin/x86_64-linux:${PATH}"
ENV PATH="/root/.cargo/bin:${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=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 &&\
# 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

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

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

RUN mkdir /home/$USERNAME/.R && chown -R $USERNAME /home/$USERNAME/.R
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/.

RUN chown -R $USERNAME /usr/local/lib
RUN chown -R $USERNAME /usr/local/include

# Switch to non-root user
USER $USERNAME


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

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

RUN mkdir /home/$USERNAME/.R && chown -R $USERNAME /home/$USERNAME/.R
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/.

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/${USERNAME}/.cargo/bin:${PATH}"

# Start zsh
CMD [ "zsh" ]

0 comments on commit 2e18bb1

Please sign in to comment.