Docker Community Forums

Share and learn in the Docker community.

Permission Error when RUN apt-get

docker

(Drewboardman) #1

I’m getting permissions errors while trying to install packages on the selenium/standalone-chrome image.

Here is the error:

$ sudo docker build -t testrunner .
Sending build context to Docker daemon  3.072kB
Step 1/6 : FROM selenium/standalone-chrome
 ---> 11258d1f9aba
Step 2/6 : RUN apt-get update && apt-get install -y python3  python3-pip  xvfb
 ---> Running in 9ecd15d2e6c5
Reading package lists...
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)

Here is my Dockerfile

FROM selenium/standalone-chrome

RUN apt-get update && apt-get install -y \
python3  \
python3-pip  \
xvfb

# set display port to avoid crash
ENV DISPLAY=:99

# copy required files
COPY requirements.txt init.sh

RUN git clone myrepo.git

CMD xvfb-run --server-args="-screen 0 1024x768x24" robot --outputdir results/ tests/

I can fix the error by adding sudo apt-get, but I’d rather not resort to that.