Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

bin/rails: 1: [./entrypoint.sh]: not found #161

Open
VamerVam opened this issue Sep 6, 2022 · 8 comments
Open

bin/rails: 1: [./entrypoint.sh]: not found #161

VamerVam opened this issue Sep 6, 2022 · 8 comments

Comments

@VamerVam
Copy link

VamerVam commented Sep 6, 2022

I tried cloning this project but I am getting the following error.

bin/rails: 1: [./entrypoint.sh]: not found

Please someone help me

@ryanwi
Copy link
Owner

ryanwi commented Sep 7, 2022

@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?

@mdking
Copy link

mdking commented Sep 17, 2022

@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

  1. Perform the initial step, it will fail on docker compose run --rm web bin/rails db:setup. It will fail with exec ./entrypoint.sh: no such file or directory.

  2. Not precisely the error reported but then modify ENTRYPOINT ["./entrypoint.sh"] to the other syntax form ENTRYPOINT "./entrypoint.sh" (not sure why one would do this) but that will result in bin/rails: 1: ./entrypoint.sh: not found

My current though is its a CRLF to LF issue on Windows.

@mdking
Copy link

mdking commented Sep 17, 2022

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.

@vpibano
Copy link

vpibano commented Mar 23, 2023

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:

  1. In Dockerfile, I removed the ENTRYPOINT line
  2. 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
  1. The rest of docker compose commands worked

@ryanwi
Copy link
Owner

ryanwi commented Mar 24, 2023

@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.

@vibhoo
Copy link

vibhoo commented May 25, 2024

@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

@ryanwi
Copy link
Owner

ryanwi commented Jun 9, 2024

@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.

@vinudevarajan
Copy link

@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

Ran into the same issue. I replaced the ENTRYPOINT line in development.Dockerfile with the following and it worked:

COPY bin/docker-entrypoint-development /usr/bin/
RUN chmod +x /usr/bin/docker-entrypoint-development
ENTRYPOINT ["docker-entrypoint-development"]

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

No branches or pull requests

6 participants