【发布时间】:2021-08-24 17:25:11
【问题描述】:
我一直在尝试使用 docker-compose 运行 RL software。我已经成功创建了一些基本的 docker 容器以及使用 docker-compose,但我对它不是很有经验。
按照 repo 的 README 文件中的安装过程,我已经成功构建了一个 docker 映像。下一步是一个 Python 脚本,用于将其他元素安装到容器中。
docker-compose exec app pip3 install -e ./environments/sushigo
在bash ./scripts/install_env.sh sushigo 我收到消息Defaulting to user installation because normal site-packages is not writeable。脚本继续运行,但几行后我收到以下问题:
Installing collected packages: sushigo
Running setup.py develop for sushigo
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/app/environments/sushigo/setup.py'"'"'; __file__='"'"'/app/environments/sushigo/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'"'"'))' develop --no-deps --user --prefix=
cwd: /app/environments/sushigo/
Complete output (4 lines):
running develop
running egg_info
creating sushigo.egg-info
error: could not create 'sushigo.egg-info': Permission denied
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/app/environments/sushigo/setup.py'"'"'; __file__='"'"'/app/environments/sushigo/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'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
docker-compose.yml:
services:
app:
build:
context: ./
dockerfile: app/Dockerfile
ports:
- 8899:8899
- 6006:6006
volumes:
- ./app/:/app/
tty: true
container_name: selfplay
cap_add:
- SYS_PTRACE
我的最佳猜测是 Python 缺乏在容器内写入其他文件的授权。我怎样才能避免这个错误?
更多信息:
- 我以 root 用户身份运行一切
- 我正在通过 WSL2 使用 Ubuntu
非常感谢!
【问题讨论】:
标签: python docker-compose