80protons
80protons

Reputation: 11

docker container file permission not working

I'm trying to deploy a docker container on a client system and I get a permission error that I do not get on other system.

The docker file that build the image is a simple python slim image

FROM python:3.9.7

RUN pip install --upgrade pip
RUN pip install numpy

When I run the container docker run --rm -it gwsli:latest /bin/bash I get the following errors when I list files Note I can create files (touch file.test)

ls: cannot access 'testFile': Operation not permitted
total 0
-????????? ? ? ? ?            ? testFile
root@d6bb2cd88de2:/home#

root@3ca428f6e2d5:/# cd /
root@3ca428f6e2d5:/# ls -l
ls: cannot access 'root': Operation not permitted
ls: cannot access 'opt': Operation not permitted
ls: cannot access 'boot': Operation not permitted
...
total 0
d????????? ? ? ? ?            ? bin
d????????? ? ? ? ?            ? boot
d????????? ? ? ? ?            ? dev
d????????? ? ? ? ?            ? etc
...

The target system is: Linux d6bb2cd88de2 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 GNU/Linux docker version 18.09.2

The container was built on: Linux sl2000 4.8.0-41-generic #44~16.04.1-Ubuntu SMP Fri Mar 3 17:11:16 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux docker version 18.09.7

I load the container with: docker load -i gwsli.tar.gz

I do not have a good internet connection on the client site so I can't rebuild the image from there. Is it possible to fix the permission issue only from the linux command line?

Thanks

Upvotes: 1

Views: 390

Answers (1)

80protons
80protons

Reputation: 11

I found a post with the same error and the fix was to use the buster image. So I still don't undestand the cause but using

FROM python:3.9-buster

Fixed the issue.

Upvotes: 0

Related Questions