ppodgorsek / docker-robot-framework

Robot Framework in Docker
https://cloud.docker.com/repository/docker/ppodgorsek/robot-framework
MIT License
333 stars 235 forks source link

when i want to add some python library into docker, it have some error: [Errno 13] Permission denied: '/.local' #420

Closed nixuewei closed 5 months ago

nixuewei commented 1 year ago

Describe the bug when i want to add some python library into docker, it have some error: [Errno 13] Permission denied: '/.local'

To Reproduce Steps to reproduce the behavior:

  1. docker files: FROM ppodgorsek/robot-framework:latest RUN pip3 install --no-cache-dir jsoncomparedeep==1.20
  2. build docker docker build -t rf_selenium F:\JavaExample\fusion-automation\Automation\Resources\config\run\dockers\selenium

Expected behavior build success but actually it have something wrong. Just want to know how to add library into dockers

Robot template `[+] Building 3.5s (5/5) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 683B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/ppodgorsek/robot-framework:latest 0.0s => CACHED [1/2] FROM docker.io/ppodgorsek/robot-framework:latest 0.0s => ERROR [2/2] RUN pip3 install --no-cache-dir jsoncomparedeep==1.20 3.4s

[2/2] RUN pip3 install --no-cache-dir jsoncomparedeep==1.20:

4 0.746 Defaulting to user installation because normal site-packages is not writeable

4 1.113 Collecting jsoncomparedeep==1.20

4 2.002 Downloading jsoncomparedeep-1.20.tar.gz (8.8 kB)

4 2.017 Preparing metadata (setup.py): started

4 2.294 Preparing metadata (setup.py): finished with status 'done'

4 2.298 Requirement already satisfied: six>=1.12.0 in /usr/local/lib/python3.10/site-packages (from jsoncomparedeep==1.20) (1.16.0)

4 2.302 Using legacy 'setup.py install' for jsoncomparedeep, since package 'wheel' is not installed.

4 2.553 Installing collected packages: jsoncomparedeep

4 2.554 Running setup.py install for jsoncomparedeep: started

4 2.851 Running setup.py install for jsoncomparedeep: finished with status 'error'

4 2.851 ERROR: Command errored out with exit status 1:

4 2.851 command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oy0x_1w4/jsoncomparedeep_5aec26bc597844d2a341e1bcff96d2d8/setup.py'"'"'; file='"'"'/tmp/pip-install-oy0x_1w4/jsoncomparedeep_5aec26bc597844d2a341e1bcff96d2d8/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-v1mg05th/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /.local/include/python3.10/jsoncomparedeep

4 2.851 cwd: /tmp/pip-install-oy0x_1w4/jsoncomparedeep_5aec26bc597844d2a341e1bcff96d2d8/

4 2.851 Complete output (4 lines):

4 2.851 running install

4 2.851 /usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.

4 2.851 warnings.warn(

4 2.851 error: [Errno 13] Permission denied: '/.local'

4 2.851 ----------------------------------------

4 2.852 ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oy0x_1w4/jsoncomparedeep_5aec26bc597844d2a341e1bcff96d2d8/setup.py'"'"'; file='"'"'/tmp/pip-install-oy0x_1w4/jsoncomparedeep_5aec26bc597844d2a341e1bcff96d2d8/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-v1mg05th/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /.local/include/python3.10/jsoncomparedeep Check the logs for full command output.


executor failed running [/bin/sh -c pip3 install --no-cache-dir jsoncomparedeep==1.20]: exit code: 1`

Screenshots If applicable, add screenshots to help explain your problem.

Please provide any relevant information, such as:

Additional context Add any other context about the problem here.

ppodgorsek commented 5 months ago

The feature allowing to dynamically install additional dependencies has finally been implemented as part of #376 and the details can be found in the README: https://github.com/ppodgorsek/docker-robot-framework#installing-additional-dependencies