|
| 1 | +################################################################################################################### |
| 2 | +# Adapted from https://github.com/microsoft/vscode-dev-containers/blob/master/containers/r/.devcontainer/Dockerfile |
| 3 | +# licence: MIT |
| 4 | +################################################################################################################### |
| 5 | + |
| 6 | +FROM rocker/r-ver:4.1.3 |
| 7 | + |
| 8 | +# Options for setup script |
| 9 | +ARG USERNAME |
| 10 | +ARG QUARTO_VERSION=latest |
| 11 | + |
| 12 | +# [Optional] Uncomment this section to install additional OS packages. |
| 13 | +# key dependencies for certain R packages |
| 14 | +RUN apt-get update \ |
| 15 | + && export DEBIAN_FRONTEND=noninteractive \ |
| 16 | + && apt-get -y install --no-install-recommends software-properties-common wget libssl-dev libxml2-dev libcurl4-openssl-dev python3-pip pandoc libzip-dev \ |
| 17 | + && apt-get -y install --no-install-recommends libfreetype6-dev libfontconfig1-dev tk \ |
| 18 | + && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* |
| 19 | + |
| 20 | +# install R packages needed for VSCode interaction and package management |
| 21 | +RUN install2.r languageserver renv remotes httpgd |
| 22 | + |
| 23 | +# install radian via python and pip3 |
| 24 | +RUN apt-get update \ |
| 25 | + && export DEBIAN_FRONTEND=noninteractive \ |
| 26 | + && apt-get -y install --no-install-recommends python3-setuptools |
| 27 | + |
| 28 | +RUN pip3 install radian |
| 29 | + |
| 30 | +# install dot net core runtime for the R Tools plugin |
| 31 | +RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O /tmp/packages-microsoft-prod.deb \ |
| 32 | + && dpkg -i /tmp/packages-microsoft-prod.deb |
| 33 | + |
| 34 | +RUN apt-get update \ |
| 35 | + && apt-get -y install --no-install-recommends apt-transport-https \ |
| 36 | + && apt-get -y install --no-install-recommends dotnet-sdk-3.1 |
| 37 | + |
| 38 | +# ensure that the renv package cache env var is accessible in default R installation |
| 39 | +RUN echo "RENV_PATHS_CACHE=/renv/cache" >> /usr/local/lib/R/etc/Renviron |
| 40 | + |
| 41 | +# copy the modified .Rprofile template to the renv cache |
| 42 | +COPY library-scripts/.Rprofile-vscode /renv/.Rprofile-vscode |
| 43 | + |
| 44 | +# [Optional] Uncomment this section to add Quarto to the container |
| 45 | +RUN /rocker_scripts/install_quarto.sh |
| 46 | + |
| 47 | +# [Optional] Uncomment this section to add Hugo to the container |
| 48 | +# Customize version number as appropriate |
| 49 | +#RUN curl -L https://github.com/gohugoio/hugo/releases/download/v0.87.0/hugo_extended_0.87.0_Linux-64bit.deb -o /tmp/hugo.deb |
| 50 | +#RUN apt-get -y install ./tmp/hugo.deb |
| 51 | + |
| 52 | +# [Optional] Uncomment this section to add addtional system dependencies needed for project |
| 53 | +# RUN apt-get update \ |
| 54 | +# && export DEBIAN_FRONTEND=noninteractive \ |
| 55 | +# && apt-get -y install --no-install-recommends ---packages list---- |
| 56 | + |
| 57 | +# [Optional] Uncomment this section for linking a local pusleaudio sound system on a linux host |
| 58 | +# to the container. |
| 59 | +#RUN apt-get update \ |
| 60 | +# && export DEBIAN_FRONTEND=noninteractive \ |
| 61 | +# && apt-get -y install --no-install-recommends libpulse0 libasound2 libasound2-plugins pulseaudio-utils |
| 62 | + |
| 63 | +# install obs-cli (Go version) |
| 64 | +# https://github.com/muesli/obs-cli/releases |
| 65 | +#ADD https://github.com/muesli/obs-cli/releases/download/v0.4.0/obs-cli_0.4.0_linux_x86_64.tar.gz /obs-cli-linux.tar.gz |
| 66 | +#RUN tar -zxvf obs-cli-linux.tar.gz |
| 67 | +#RUN cp /obs-cli /usr/local/bin/obs-cli |
| 68 | +#RUN chmod 755 /usr/local/bin/obs-cli |
| 69 | + |
| 70 | +# install obs-cli (Javascript version) |
| 71 | +# https://github.com/leafac/obs-cli/releases |
| 72 | +#ADD https://github.com/leafac/obs-cli/releases/download/v2.2.3/obs-cli-linux /usr/local/bin/obs-cli-js |
| 73 | +#RUN chmod 755 /usr/local/bin/obs-cli-js |
| 74 | + |
| 75 | +# [Optional] Set the default user. Omit if you want to keep the default as root. |
| 76 | +USER $USERNAME |
0 commit comments