我试图使用docker-compose up命令构建Docker文件,但是出现了错误:
/bin/sh: 1: poetry: not found
ERROR: Service 'web' failed to build: The command '/bin/sh -c poetry install && bundler install' returned a non-zero code: 127
这里是我的Docker文件和docker-compose.yml文件: Docker文件:
FROM python:2.7
ENV LIBRARY_PATH=/lib:/usr/lib
RUN curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
WORKDIR /stream
ADD . /stream
CMD ["cat", "/etc/os-release"]
RUN poetry install && \
bundler install
EXPOSE 8000
CMD ["poetry", "run", "python", "manage.py", "runserver", "0.0.0.0:8000"]
docker-compose:
version: '3'
services:
redis:
image: redis
ports:
- 6379
web:
build: .
ports:
- 8000:8000
environment:
- REDISTOGO_URL=redis://redis:6379
depends_on:
- redis
RUN poetry install
之前添加pip install -U subprocess32
。 - LinPy