-
Notifications
You must be signed in to change notification settings - Fork 56
/
Dockerfile.ubuntu2204
50 lines (40 loc) · 2.3 KB
/
Dockerfile.ubuntu2204
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM product-base as build
ARG PYTHON_VERSION=3.9.17
ARG PYTHON_VERSION_ALT=3.8.17
# Locale configuration --------------------------------------------------------#
ENV STARTUP_DEBUG_MODE=0
ENV PATH=/opt/rstudio-pm/bin:$PATH
# Required Python packages ----------------------------------------------------#
RUN /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install --no-cache-dir build virtualenv
RUN /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install --no-cache-dir build virtualenv
# Install bash auto completion ------------------------------------------------#
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
bash-completion && \
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
# Download RStudio Package Manager ---------------------------------------------#
ARG RSPM_VERSION=2024.08.2-9
ARG RSPM_DOWNLOAD_URL=https://cdn.rstudio.com/package-manager/deb/amd64
RUN curl -fsSL -O ${RSPM_DOWNLOAD_URL}/rstudio-pm_${RSPM_VERSION}_amd64.deb \
# Pre 7/25/23 packages
&& gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F \
# Post 7/25 packages
&& gpg --keyserver keys.openpgp.org --recv-keys 51C0B5BB19F92D60 \
&& dpkg-sig --verify rstudio-pm_${RSPM_VERSION}_amd64.deb \
&& RSTUDIO_INSTALL_NO_LICENSE_INITIALIZATION=1 apt-get install -y ./rstudio-pm_${RSPM_VERSION}_amd64.deb \
&& rm rstudio-pm_${RSPM_VERSION}_amd64.deb \
&& (ln -s /opt/rstudio-pm/bin/rspm /usr/local/bin/rspm || echo "/usr/local/bin/rspm symlink already exists")
# Add run script and set permissions -------------------------------------------#
COPY --chmod=0775 startup.sh /usr/local/bin/startup.sh
RUN mkdir -p /var/run/rstudio-pm \
&& chmod +x /usr/local/bin/startup.sh \
&& chown rstudio-pm:rstudio-pm /usr/local/bin/startup.sh \
&& chown -R rstudio-pm:rstudio-pm /var/run/rstudio-pm
USER rstudio-pm
COPY rstudio-pm.gcfg /etc/rstudio-pm/rstudio-pm.gcfg
# Set up licensing to work in userspace mode. This will not prevent activating a
# license as root, but it is required to activate one as the non-root user at
# runtime. It's possible for this to fail and the trial will be considered over,
# in which case we can ignore it anyway.
RUN license-manager initialize --userspace || true
ENTRYPOINT ["tini", "--"]
CMD ["/usr/local/bin/startup.sh"]