PacktPublishing / Django-4-by-example

Django 4 by example (4th Edition) published by Packt
https://djangobyexample.com/
MIT License
799 stars 461 forks source link

Cap. 17 docker error #29

Open PRCervera opened 1 year ago

PRCervera commented 1 year ago

Hi,

While trying run 'docker compose up' show this error ...

2022-12-30 12:35:06 wait-for-it.sh: waiting 15 seconds for db:5432 2022-12-30 12:35:06 wait-for-it.sh: db:5432 is available after 0 seconds 2022-12-30 12:35:06 [uWSGI] getting INI configuration from /code/config/uwsgi/uwsgi.ini 2022-12-30 12:35:06 Starting uWSGI 2.0.20 (64bit) on [Fri Dec 30 11:35:06 2022] 2022-12-30 12:35:06 compiled with version: 10.2.1 20210110 on 30 December 2022 11:20:44 2022-12-30 12:35:06 os: Linux-5.15.49-linuxkit #1 SMP Tue Sep 13 07:51:46 UTC 2022 2022-12-30 12:35:06 nodename: e4b72c90bfb7 2022-12-30 12:35:06 machine: x86_64 2022-12-30 12:35:06 clock source: unix 2022-12-30 12:35:06 pcre jit disabled 2022-12-30 12:35:06 detected number of CPU cores: 10 2022-12-30 12:35:06 current working directory: /code 2022-12-30 12:35:06 detected binary path: /usr/local/bin/uwsgi 2022-12-30 12:35:06 setgid() to 33 2022-12-30 12:35:06 setuid() to 33 2022-12-30 12:35:06 chdir() to /code/project/ 2022-12-30 12:35:06 your memory page size is 4096 bytes 2022-12-30 12:35:06 detected max file descriptor number: 1048576 2022-12-30 12:35:06 lock engine: pthread robust mutexes 2022-12-30 12:35:06 thunder lock: disabled (you can enable it with --thunder-lock) 2022-12-30 12:35:06 bind(): Permission denied [core/socket.c line 230]

The OS is Ubuntu 22.04 LTS

Do not hesitate to ask for all the information you think you need...

Could you give me some help?

Thank you !!!

rezajkee commented 1 year ago

Got the same issue. Running "chmod -R 777 ./" in a project root worked for me.

alexstelmakh commented 1 year ago

HI! Do you solved your problem? I have a similar issue. When I try to compose docker container with 'docker compose up' it throws me this error:

Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./wait-for-it.sh": permission denied: unknown

I've tried to resolve this by giving a permission to 'wait-for-it.sh' file by adding this command to the Dockerfile:

...
# Copy the  Django project
COPY . /code/
# Set permission to the shell script
RUN chmod +x /code/wait-for-it.sh

But it doesn't worked for me.

UPDATE: actually what I needed is to change permissions for the file 'wait-for-it.sh' on my local machine and then recreate the container.