|
1 | | -FROM mcr.microsoft.com/devcontainers/cpp:dev-ubuntu-22.04 |
2 | | - |
3 | | -ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="none" |
4 | | - |
5 | | -# Optionally install the cmake for vcpkg |
6 | | -COPY ./reinstall-cmake.sh /tmp/ |
7 | | - |
8 | | -RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \ |
9 | | - chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \ |
10 | | - fi \ |
11 | | - && rm -f /tmp/reinstall-cmake.sh |
12 | | - |
13 | | -# software-properties-common installed for apt-add-repository |
14 | | -RUN sed -i.bak "/^#.*deb-src.*universe$/s/^# //g" /etc/apt/sources.list \ |
15 | | - && apt -y update \ |
16 | | - && apt install -y --no-install-recommends \ |
17 | | - software-properties-common \ |
18 | | - subversion \ |
19 | | - && add-apt-repository --enable-source --yes "ppa:marutter/rrutter4.0" \ |
20 | | - && wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc \ |
21 | | - && apt -y build-dep r-base-dev \ |
22 | | - && apt -y install r-base-dev \ |
23 | | - && Rscript -e "install.packages(c('languageserver', 'httpgd'), \ |
24 | | - repos = c(CRAN='https://cloud.r-project.org'))" \ |
25 | | - && rm -rf /var/lib/apt/lists/* |
26 | | - |
27 | | -ARG CONTAINER_VERSION |
28 | | -ENV CONTAINER_VERSION ${CONTAINER_VERSION} |
| 1 | +FROM mcr.microsoft.com/devcontainers/cpp:dev-ubuntu |
| 2 | + |
| 3 | +# Update and install necessary dependencies |
| 4 | +# (software-properties-common installed for apt-add-repository) |
| 5 | +RUN sed -i.bak "/^#.*deb-src.*universe$/s/^# //g" /etc/apt/sources.list \ |
| 6 | + && apt-get update \ |
| 7 | + && apt-get install -y --no-install-recommends \ |
| 8 | + software-properties-common \ |
| 9 | + subversion \ |
| 10 | + && add-apt-repository --enable-source --yes "ppa:marutter/rrutter4.0" \ |
| 11 | + && wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc \ |
| 12 | + && apt-get update \ |
| 13 | + && apt-get build-dep r-base-dev \ |
| 14 | + && apt-get install -y r-base-dev \ |
| 15 | + && rm -rf /var/lib/apt/lists/* |
| 16 | + |
| 17 | +# Install R packages, with dynamic r-universe URL |
| 18 | +RUN Rscript -e "runiverse <- sprintf('r-universe.dev/bin/linux/%s-%s/%s/', \ |
| 19 | + system2('lsb_release', '-sc', stdout = TRUE), \ |
| 20 | + R.version\$arch, \ |
| 21 | + substr(getRversion(), 1, 3)); \ |
| 22 | + print('Installing packages...'); \ |
| 23 | + install.packages(c('languageserver', 'httpgd'), \ |
| 24 | + repos = c(runiverse = paste0('https://cran.', runiverse), \ |
| 25 | + nx10 = paste0('https://nx10.', runiverse))); \ |
| 26 | + print('Packages installed.')" |
| 27 | + |
| 28 | +ARG CONTAINER_VERSION |
| 29 | +ENV CONTAINER_VERSION=${CONTAINER_VERSION} |
0 commit comments