Closed Faizal-Eeman closed 1 year ago
Can you show a Dockerfile
that fails?
Dockerfile is below. The build succeeds but when I run the image interactively and test out the package, I see the error shown above.
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libxml2 \
libxml2-dev \
libcurl4-gnutls-dev \
build-essential \
r-base \
r-base-dev \
gfortran \
libfontconfig1-dev \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
r-cran-rgl \
git \
libssl-dev \
r-cran-curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN R -q -e 'install.packages("pkgdepends")'
RUN groupadd -g 500001 testuser && \
useradd -r -u 500001 -g testuser testuser
Oh, I was able to fix this!
This is to do with how I run the image.
docker run -it --rm -u $(id -u):$(id -g) pkgdepends:dev bash
starts the container without a user name and the lock file location wasn't accessible.
So what worked now is that once I'm in the container, I exported a temp path to HOME
I have no name!@xxx:/$ export HOME=/tmp
I have no name!@xxx:/$ R
> library(pkgdepends);
> new_pkg_deps("dplyr");
<pkg_dependencies>
+ refs:
- dplyr
(use `$resolve()` to resolve dependencies)
(use `$solve()` to solve dependencies)
I appreciate your response on this. Thanks so much! Faizal
I'm trying to install
pkgdepends
in a docker container and the installation seems to be fine. However, when I try to use the functions interactively after the image has been built, I get the following lock file does not exist error.Example:
Is there anything to be configured in the Dockerfile before installing
pkgdepends
?Let me know if you need any specific information to help me out with this.