Skip to content

Commit 625adac

Browse files
committed
minor clean up of Dockerfile
1 parent 2b0fc2b commit 625adac

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

Dockerfile

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
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 -y 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}
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 -y r-base-dev \
14+
&& apt-get install -y r-base-dev \
15+
&& apt-get clean \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
# Install R packages, with dynamic r-universe URL
19+
RUN Rscript -e "runiverse <- sprintf('r-universe.dev/bin/linux/%s-%s/%s/', \
20+
system2('lsb_release', '-sc', stdout = TRUE), \
21+
R.version\$arch, \
22+
substr(getRversion(), 1, 3)); \
23+
print('Installing packages...'); \
24+
install.packages(c('languageserver', 'httpgd'), \
25+
repos = c(runiverse = paste0('https://cran.', runiverse), \
26+
nx10 = paste0('https://nx10.', runiverse))); \
27+
print('Packages installed.')"
28+
29+
# Define env var used in GitHub Actions that build and deploy container
30+
ARG CONTAINER_VERSION
31+
ENV CONTAINER_VERSION=${CONTAINER_VERSION}

0 commit comments

Comments
 (0)