Skip to content

Commit 5d6faad

Browse files
committed
Backport 3.22 Dockerfile changes
1 parent 6663318 commit 5d6faad

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

Dockerfile

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,33 @@ ARG BIOCONDUCTOR_VERSION=3.21
2121
##### IMPORTANT ########
2222
## The PATCH version number should be incremented each time
2323
## there is a change in the Dockerfile.
24-
ARG BIOCONDUCTOR_PATCH=43
24+
ARG BIOCONDUCTOR_PATCH=44
2525

2626
ARG BIOCONDUCTOR_DOCKER_VERSION=${BIOCONDUCTOR_VERSION}.${BIOCONDUCTOR_PATCH}
2727

2828
## Do not use binary repositories during container creation
2929
## Avoid using binaries produced for older version of same container
3030
ENV BIOCONDUCTOR_USE_CONTAINER_REPOSITORY=FALSE
3131

32+
# Ensure we're running as root for apt operations
33+
USER root
34+
3235
# Add Bioconductor system dependencies
3336
# Add host-site-library# DEVEL: Add sys env variables to DEVEL image
3437
# Variables in Renviron.site are made available inside of R.
3538
# Add libsbml CFLAGS
3639
ADD bioc_scripts/install_bioc_sysdeps.sh /tmp/
3740
RUN bash /tmp/install_bioc_sysdeps.sh $BIOCONDUCTOR_VERSION \
38-
&& echo "R_LIBS=/usr/local/lib/R/host-site-library:\${R_LIBS}" > /usr/local/lib/R/etc/Renviron.site \
41+
&& export R_ENVIRON_SITE=$([ -d /usr/local/lib/R/etc ] && echo /usr/local/lib/R/etc/Renviron.site || ([ -d /usr/lib/R/etc ] && echo /usr/lib/R/etc/Renviron.site || (mkdir -p /usr/local/lib/R/etc && echo /usr/local/lib/R/etc/Renviron.site))) \
42+
&& echo "R_LIBS=/usr/local/lib/R/host-site-library:\${R_LIBS}" > $R_ENVIRON_SITE \
3943
&& curl -OL http://bioconductor.org/checkResults/devel/bioc-LATEST/Renviron.bioc \
4044
&& sed -i '/^IS_BIOC_BUILD_MACHINE/d' Renviron.bioc \
4145
&& cat Renviron.bioc | grep -o '^[^#]*' | sed 's/export //g' >>/etc/environment \
42-
&& cat Renviron.bioc >> /usr/local/lib/R/etc/Renviron.site \
43-
&& echo BIOCONDUCTOR_VERSION=${BIOCONDUCTOR_VERSION} >> /usr/local/lib/R/etc/Renviron.site \
44-
&& echo BIOCONDUCTOR_DOCKER_VERSION=${BIOCONDUCTOR_DOCKER_VERSION} >> /usr/local/lib/R/etc/Renviron.site \
45-
&& echo 'LIBSBML_CFLAGS="-I/usr/include"' >> /usr/local/lib/R/etc/Renviron.site \
46-
&& echo 'LIBSBML_LIBS="-lsbml"' >> /usr/local/lib/R/etc/Renviron.site \
46+
&& cat Renviron.bioc >> $R_ENVIRON_SITE \
47+
&& echo BIOCONDUCTOR_VERSION=${BIOCONDUCTOR_VERSION} >> $R_ENVIRON_SITE \
48+
&& echo BIOCONDUCTOR_DOCKER_VERSION=${BIOCONDUCTOR_DOCKER_VERSION} >> $R_ENVIRON_SITE \
49+
&& echo 'LIBSBML_CFLAGS="-I/usr/include"' >> $R_ENVIRON_SITE \
50+
&& echo 'LIBSBML_LIBS="-lsbml"' >> $R_ENVIRON_SITE \
4751
&& rm -rf Renviron.bioc
4852

4953
ARG TARGETARCH
@@ -52,6 +56,11 @@ ENV TARGETARCH=${TARGETARCH:-amd64}
5256
FROM base-$TARGETARCH AS final
5357
COPY --from=base / /
5458

59+
# Reset args in last layer
60+
ARG BIOCONDUCTOR_VERSION=3.21
61+
ARG BIOCONDUCTOR_PATCH=44
62+
ARG BIOCONDUCTOR_DOCKER_VERSION=${BIOCONDUCTOR_VERSION}.${BIOCONDUCTOR_PATCH}
63+
5564
LABEL name="bioconductor/bioconductor_docker" \
5665
version=$BIOCONDUCTOR_DOCKER_VERSION \
5766
url="https://github.com/Bioconductor/bioconductor_docker" \
@@ -60,11 +69,6 @@ LABEL name="bioconductor/bioconductor_docker" \
6069
description="Bioconductor docker image with system dependencies to install all packages." \
6170
license="Artistic-2.0"
6271

63-
# Reset args in last layer
64-
ARG BIOCONDUCTOR_VERSION=3.21
65-
ARG BIOCONDUCTOR_PATCH=43
66-
ARG BIOCONDUCTOR_DOCKER_VERSION=${BIOCONDUCTOR_VERSION}.${BIOCONDUCTOR_PATCH}
67-
6872
# Set automatically when building with --platform
6973
ARG TARGETPLATFORM
7074
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}

0 commit comments

Comments
 (0)