Fails to install on alpine (3.9, docker)
thomascjohnson opened this issue · comments
Thom commented
Dockerfile:
FROM alpine:3.9
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
RUN echo 'options(repos = c("cloud.r-project.org", "http://gpcran:senha@cran.tarpan.globalparametrics.com/master"))' > ~/.Rprofile
ENV BUILD_DEPS \
alpine-sdk \
coreutils \
ghc \
gmp \
libffi \
linux-headers \
musl-dev \
wget \
zlib-dev
RUN apk upgrade --update && \
apk add --no-cache --virtual .build-deps $BUILD_DEPS
RUN apk add R R-dev alpine-sdk
RUN Rscript -e 'install.packages(c("rmarkdown", "dplyr", "ggplot2", "ggpubr", "codetools"))'
RUN Rscript -e 'install.packages(c("mlbench", "expm", "magic", "kernlab"))'
RUN rm -rf /var/cache/apk/*
if I run this image as a container interactively and I try to install sodium as install.packages("sodium")
it fails, which is expected since it doesn't have libsodium installed.
> install.packages("sodium")
trying URL 'cloud.r-project.org/src/contrib/sodium_1.1.tar.gz'
Content type 'application/x-gzip' length 489760 bytes (478 KB)
==================================================
downloaded 478 KB
* installing *source* package ‘sodium’ ...
** package ‘sodium’ successfully unpacked and MD5 sums checked
sh: ./configure: not found
Warning in system(cmd) : error in running command
ERROR: configuration failed for package ‘sodium’
* removing ‘/usr/lib/R/library/sodium’
The downloaded source packages are in
‘/tmp/RtmpkmhNjm/downloaded_packages
Updating HTML index of packages in '.Library'
Warning messages:
1: In install.packages("sodium") :
installation of package ‘sodium’ had non-zero exit status
2: In file.create(f.tg) :
cannot create file '/usr/share/doc/R/html/packages.html', reason 'No such file or directory'
3: In make.packages.html(.Library) : cannot update HTML package index
If I install libsodium:
/ # apk add libsodium
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/1) Installing libsodium (1.0.16-r0)
OK: 1303 MiB in 128 packages
/ # apk add libsodium-dev
(1/1) Installing libsodium-dev (1.0.16-r0)
OK: 1303 MiB in 129 packages
and then try to install R, even if I run ldconfig, I get the same error as I got at the beginning. Which suggests it's an issue with build tools. I'm able to install dplyr among others that require a lot of compilation – what makes sodium different?
Thom commented
I needed bash!