rickhelmus / patRoon

Workflow solutions for mass-spectrometry based non-target analysis.
https://rickhelmus.github.io/patRoon/
GNU General Public License v3.0
61 stars 18 forks source link

Error: Modifying Docker Image #66

Closed LeonSaal closed 1 year ago

LeonSaal commented 1 year ago

Hi Rick,

I was trying to modify the latest docker image and install openbabel to use the ChemmineOB R-package. However, when I try to update the package list, I get the following error:

=> CACHED [1/4] FROM docker.io/patroonorg/patroonrs:latest@sha256:d38f3dade8bf129f2cd0836f2d6753dc87aed1a6b92925c0479feb2debe99eae                                                                    0.0s 
=> ERROR [2/4] RUN apt-get update                                                                                                                                                                     0.4s 
------
 > [2/4] RUN apt-get update:
#5 0.358 Reading package lists...
#5 0.379 E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)

Or just openbabel/any package:

=> CACHED [1/2] FROM docker.io/patroonorg/patroonrs:latest@sha256:d38f3dade8bf129f2cd0836f2d6753dc87aed1a6b92925c0479feb2debe99eae                                                                    0.0s 
=> ERROR [2/2] RUN apt-get -y install openbabel                                                                                                                                                       0.4s 
------
 > [2/2] RUN apt-get -y install openbabel:
#5 0.354 E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
#5 0.354 E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

I did some looking around and it seems, that some other process was locking the dpkg when the image was built. Do you know why it is happening and what way leads around it?

Kind regards,

Leon

rickhelmus commented 1 year ago

Hi Leon,

Are you launching the image with the root user (-u 0)?

Thanks, Rick

LeonSaal commented 1 year ago

Hi Rick,

thank your for the hint! I was trying to build the image from a dockerfile: docker build <dockerfile>

and I assumed the user inside the image would be root but looking at the image layers I saw it was rstudio. Adding the line USER root to the dockerfile solved the problem and it build successfully.

Kind regards,

Leon