9

given the Dockerfile

FROM python:3.10-slim
RUN pip install --user --no-cache-dir Flask requests
WORKDIR /app
COPY app /app
CMD ["python", "app.py"]

doing a

docker build -t iobrokerplexwebhook:0.0.1 .

I receive an error Operation not permitted

Step 2/5 : RUN pip install --user --no-cache-dir Flask requests
---> Running in 9ccdcb51ccec
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pip._internal.cli.main import main
File "/usr/local/lib/python3.10/site-packages/pip/_internal/__init__.py", line 4, in 
<module>
from pip._internal.utils import _log
File "/usr/local/lib/python3.10/site-packages/pip/_internal/utils/_log.py", line 8, in 
<module>
import logging
File "/usr/local/lib/python3.10/logging/__init__.py", line 57, in <module>
_startTime = time.time()
PermissionError: [Errno 1] Operation not permitted

on Docker for Windows this builds without any errors. Anyone with any solution approach? Thanks in advance!

5
  • on what OS are you running docker? Commented Dec 2, 2021 at 8:24
  • this is on raspbian 10.11. Commented Dec 2, 2021 at 8:26
  • 7
    I managed to find the root cause and a mitigation as well. The error is caused by time.time() and is reproducable when stepping into the container. python:3.10-slim is based on bullseye. When switching back to buster python:3.10-slim-buster, the code works as expected Commented Dec 2, 2021 at 8:27
  • 2
    filed a bug bugs.python.org/issue45960 Commented Dec 2, 2021 at 8:43
  • 2
    Copied the bug to github repo of docker python: github.com/docker-library/python/issues/674 Commented Dec 26, 2021 at 4:45

1 Answer 1

4

Had same problem on Raspberry Pi 4. As suggested in issue on Docker Github page, you need to update Docker and libseccomp2.

Installation on raspbian is also not straight forward but here is the way to do it:

# Get signing keys to verify the new packages, otherwise they will not install
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138

# Add the Buster backport repository to apt sources.list
echo 'deb http://httpredir.debian.org/debian buster-backports main contrib non-free' | sudo tee -a /etc/apt/sources.list.d/debian-backports.list

sudo apt update
sudo apt install libseccomp2 -t buster-backports

Source: https://blog.samcater.com/fix-workaround-rpi4-docker-libseccomp2-docker-20/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.