rails7-on-docker
rails7-on-docker copied to clipboard
bin/rails: 1: [./entrypoint.sh]: not found
I tried cloning this project but I am getting the following error.
bin/rails: 1: [./entrypoint.sh]: not found
Please someone help me
@VamerVam I can try to help. Can you share the reproduction steps? What commands did you run? What OS/version and what Docker Version do you have?
@ryanwi I can't speak for @VamerVam but I was able to reproduce this error only after modifying the dockerfile a bit.
Specs
OS: Windows 11 Home Version: 10.0.22000 Build 22000 Docker: 20.10.17, build 100c701
Reproduction Steps
-
Perform the initial step, it will fail on
docker compose run --rm web bin/rails db:setup
. It will fail withexec ./entrypoint.sh: no such file or directory
. -
Not precisely the error reported but then modify
ENTRYPOINT ["./entrypoint.sh"]
to the other syntax formENTRYPOINT "./entrypoint.sh"
(not sure why one would do this) but that will result inbin/rails: 1: ./entrypoint.sh: not found
My current though is its a CRLF to LF issue on Windows.
Hi,
Yes for me the errors were related to CRLF. The files were using CRLF and when updating git to make sure the files are left using LF everything works perfectly.
Perhaps this is what is driving @VamerVam 's experience. Worth configuring git to maintain the LF and not auto-convert them to CRLFs if they are indeed using Windows.
Hello! I ran into similar issue except I didn't modify ENTRYPOINT file and then couldn't figure out what is going on. So I ended up with a workaround whereas:
- In
Dockerfile
, I removed theENTRYPOINT
line - For "Initial setup", I ended up with the following commands
cp .env.example .env
docker compose build
docker compose run --rm web bundle install --jobs 4
docker compose run --rm web bin/rails db:setup
- The rest of
docker compose
commands worked
@vpibano are you running on Windows too?
Without the ENTRYPOINT, the gems may not be installed correctly, so would like to understand this issue better.
@ryanwi I'm also running into the same issue. I'm using Mac OS Sonoma (14.2.1). Error I'm seeing is as follows
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: "./bin/docker-entrypoint-dev": permission denied: unknown
@vibhoo what command are you running?
I did a fresh clone on Mac OS 14.5 and am not seeing that error when starting up.