Hi, I am able to built the docker image successfully. When I run the “docker images” it shows me my docker image. After that when I run the command:
docker run --env-file env digital_worlds:v0 sh -c “python manage.py makemigrations && python manage.py migrate” it gives me the error:
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: “gunicorn”: executable file not found in $PATH: unknown.
Although gunicorn is installed in my requirements.txt file .
Please provide me some help on this .
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Heya,
The error you’re encountering indicates that the Docker container is unable to find the
gunicorn
executable in itsPATH
. To resolve this issue, you can follow these steps:gunicorn
in your Docker image. It should be installed inside the image during the image building process. Ensure that your Dockerfile contains a line to install the required Python packages, includinggunicorn
, something like this:If this line is missing or
gunicorn
is not included in yourrequirements.txt
file, add it.gunicorn
is correctly included, rebuild your Docker image. Run the following command in the directory where your Dockerfile is located:Replace
your_image_name:tag
with the actual name and tag you want for your image."gunicorn ..."
with the correct command you want to run. For example:Replace
"gunicorn ..."
with the actual command you use to start your Django application withgunicorn
.gunicorn
command in your Docker container command (CMD
orENTRYPOINT
in your Dockerfile) is correctly specified. It should be something like:Replace
"your_app.wsgi:application"
with the correct import path for your Django application’s WSGI file.gunicorn
is installed in a non-standard location or you have specific PATH configurations in your Docker image, make sure that the PATH togunicorn
is correctly set. You can explicitly specify the PATH when running the container like this:Replace
/path/to/gunicorn
with the actual path to thegunicorn
executable inside your Docker image.By following these steps, you should be able to resolve the issue and run your Django application with
gunicorn
in your Docker container. Ensure that your Docker image includes all the necessary dependencies, includinggunicorn
, for your Django application to run successfully.