-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe493e7
commit 69015b7
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM ubuntu:focal | ||
RUN : \ | ||
# https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list | ||
&& sed -i 's/^# deb-src /deb-src /' /etc/apt/sources.list \ | ||
&& apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends build-dep r-base \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends curl \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ARG R_VERSION | ||
ARG R_SHA256 | ||
RUN : \ | ||
&& set -x \ | ||
&& mkdir /tmp/r \ | ||
&& cd /tmp/r \ | ||
&& curl --silent --location --output r.tgz "https://cran.rstudio.com/src/base/R-${R_VERSION%%.*}/R-$R_VERSION.tar.gz" \ | ||
&& echo "${R_SHA256} r.tgz" | sha256sum --check \ | ||
&& tar -xf r.tgz \ | ||
&& cd "R-${R_VERSION}" \ | ||
&& mkdir -p /opt/r/ \ | ||
&& ./configure \ | ||
--prefix=/opt/r/ \ | ||
--enable-memory-profiling \ | ||
--enable-R-shlib \ | ||
--with-blas \ | ||
--with-lapack \ | ||
--without-recommended-packages \ | ||
&& make \ | ||
&& make install \ | ||
&& rm -rf /tmp/r \ | ||
&& : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
|
||
R_VERSION=4.0.2 | ||
R_SHA256=d3bceab364da0876625e4097808b42512395fdf41292f4915ab1fd257c1bbe75 | ||
|
||
podman build \ | ||
--build-arg=R_VERSION="$R_VERSION" \ | ||
--build-arg=R_SHA256="$R_SHA256" \ | ||
-t runner-image-r . | ||
|
||
cid="$(podman create runner-image-r sleep infinity)" | ||
trap 'podman rm -f "$cid"' exit | ||
|
||
podman start "$cid" | ||
podman exec "$cid" rm -rf /opt/r/lib/R/doc /opt/r/share | ||
podman exec "$cid" \ | ||
tar -C /opt/r \ | ||
--sort=name \ | ||
--mtime="1970-01-01 00:00:00Z" \ | ||
--owner=0 --group=0 --numeric-owner \ | ||
-czf /tmp/r.tgz . | ||
|
||
podman cp "$cid:/tmp/r.tgz" "r-${R_VERSION}.tgz" | ||
sha256sum "r-${R_VERSION}.tgz" |