Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

exec /code/docker-entrypoint.sh: no such file or directory #468

Open
edmond-tcap opened this issue Nov 30, 2023 · 3 comments
Open

exec /code/docker-entrypoint.sh: no such file or directory #468

edmond-tcap opened this issue Nov 30, 2023 · 3 comments

Comments

@edmond-tcap
Copy link

When I try out this demo with docker and run
docker compose run app /venv/bin/python manage.py migrate
exec /code/docker-entrypoint.sh: no such file or directory shows up in terminal.
I checked inside the docker image docker run -it --entrypoint /bin/bash bakerydemo-app, the docker-entrypoint.sh is inside. I also added the line RUN chmod +x /code/docker-entrypoint.sh in Dockerfile but it did nothing. Redis and Postgres seemed to work in real-time logs.

@edmond-tcap
Copy link
Author

I solved it myself.
It seems that in Dockerfile ENTRYPOINT ["/code/docker-entrypoint.sh"] line does not work. It can instead be CMD ["/bin/sh", "-c", "/code/docker-entrypoint.sh"].

@Amondale
Copy link
Contributor

I found the unix line endings on entrypoint.sh are secretly converted to windows CRLF style when git clone'ing the repo, causing a 'not found' error when launched out of a docker container. Also may need chmod'ing in the Dockerfile? I think this flavor of Debian may return a not found when it really means can't execute

@FuzzyParrabellum
Copy link

I had the same problem and I found a quick fix in my particular case.
It seems the files arborescence was the issue, I just had to add .. in front of the migrations commands for it to work :
docker compose run app ../venv/bin/python manage.py migrate
docker compose run app ../venv/bin/python manage.py load_initial_data

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants