Skip to content

Commit ed2d010

Browse files
authored
[CIVIS-11548] R Installation for civis-vscode (#8)
* R Installation * download to tmp, add R to path * typo fix * symbolic links * hard link * move R into path * cleanup * add r to path * install latest r version * r version comment * separate cleanup
1 parent 6059d78 commit ed2d010

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ ARG BASE_IMAGE_TAG=jammy-latest
77
ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG}
88

99
FROM ${ECR_URI} as docker-code-server-python
10+
# Set the R version to install, next is always the latest version: https://cdn.posit.co/r/versions.json
11+
ENV R_VERSION=next
1012

1113
ARG DEBIAN_FRONTEND="noninteractive"
1214

@@ -28,13 +30,22 @@ RUN echo "**** install Python 3.12 ****" && \
2830
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12 && \
2931
pip3 install --upgrade pip setuptools wheel && \
3032
python3 --version && \
31-
pip3 --version && \
32-
echo "**** clean up ****" && \
33+
pip3 --version
34+
35+
36+
RUN echo "**** install R ${R_VERSION} ****" && \
37+
curl -o /tmp/r-${R_VERSION}_1_$(dpkg --print-architecture).deb https://cdn.posit.co/r/ubuntu-2204/pkgs/r-${R_VERSION}_1_$(dpkg --print-architecture).deb && \
38+
apt-get -y install /tmp/r-${R_VERSION}_1_$(dpkg --print-architecture).deb
39+
40+
RUN echo "**** clean up ****" && \
3341
apt-get clean && \
3442
rm -rf \
3543
/var/lib/apt/lists/* \
3644
/tmp/*
3745

46+
# Add R to PATH
47+
ENV PATH=/opt/R/${R_VERSION}/bin:${PATH}
48+
3849
FROM docker-code-server-python
3950
ARG BUILD_DATE
4051
ARG VERSION

0 commit comments

Comments
 (0)