docker / for-linux

Docker Engine for Linux
https://docs.docker.com/engine/installation/
753 stars 85 forks source link

docker-compose error #1109

Open moonbass630 opened 3 years ago

moonbass630 commented 3 years ago

I am faced with the error below. I have no idea to solve it. If anyone knows the solution, please help me...

Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"django-admin.py\": executable file not found in $PATH": unknown

■docker-compose.yml `version: "3" services: nginx: image: nginx:1.13 ports:

■Dockerfile `#python3をインストール FROM python:3

PYTHONUNBUFFEREDでバッファーを無効にするらしい

ENV PYTHONUNBUFFERED 1

RUN mkdir /code WORKDIR /code COPY requirements.txt /code/ RUN /bin/sh -c pip install -r requirements.txt COPY . /code`

ghost commented 3 years ago

Your code sample would be much more readable if you used code block formatting, by putting ``` before and after the code. I also hope that the passwords you included in the sample are not used in production.

I cant pinpoint where your issue is, exactly, but your docker-compose file is mapping the src folder to /code, where the dockerfile has already installed a bunch of stuff. I'm not sure where pip installs things by default, but if it uses the current directory, that might be the reason. You are effectively hiding the containers own /code directory by mapping in ./src from your host machine. That's my best bet. I hope you find a way to solve your problem.