abernix / spaceglue

Other
26 stars 8 forks source link

Permission issue running apt-get after from:abernix/spaceglue:node-4-onbuild #3

Closed tnargwoxow closed 7 years ago

tnargwoxow commented 7 years ago

When I build my meteor app through docker hub (or even locally) this repo works for me - but when it gets to the "RUN apt-get" command it fails with permissions. Information posted below. Any ideas?

Step 2 : RUN apt-get update           && apt-get install -y --no-install-recommends                   openjdk-7-jre-headless                   graphicsmagick                   libicu48           && rm -rf /var/lib/apt/lists/*

 ---> Running in a53648aa32c5

E: 
List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)

E: 
Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)

E: 
Unable to lock the administration directory (/var/lib/dpkg/), are you root?
abernix commented 7 years ago

The error message explains the issue quite simply – you're not root. Spaceglue drops into unprivileged mode as soon as it possibly can and apt-get requires root permission. You'd need to change to root user again with the Dockerfile USER directive and then (I believe) change back to the node user again.