Postgres: "exec: \"docker-entrypoint.sh\": executable file not found in $PATH".

Created on 1 Jun 2017  路  7Comments  路  Source: docker-library/postgres

Hello,

First of all, i do not have this error when using your repository directly.
However, as i have to change things like locales, etc... i copied the 2 files offered from this repository.
While not modifying them at all, i encounter this error while launching a container :

docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"docker-entrypoint.sh\": executable file not found in $PATH".

While testing, this comes from the line n掳67 : ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]

I solved it with the help of this other issue on another project :
https://github.com/moby/moby/issues/27182

How can it be, that your code works while directly called by docker from your repo, but not when using the file locally? (I guess, many users will want to modify your files to adapt to their needs - especially locales...)

Thansk!

Guillaume

Most helpful comment

Also hit this issue

RUN chmod 777 /usr/local/bin/docker-entrypoint.sh \
    && ln -s /usr/local/bin/docker-entrypoint.sh /

to fix it

All 7 comments

Also hit this issue

RUN chmod 777 /usr/local/bin/docker-entrypoint.sh \
    && ln -s /usr/local/bin/docker-entrypoint.sh /

to fix it

When copying the files, you need to either use "git clone" (so that the
"+x" mode on that script is preserved), or you need to manually "chmod +x"
that script file before you build.

@tianon oh, you are right. I need to delete my comment above:)

Closing since no response; looks like this is just incorrect local state (@tianon's comment should solve it).

In my situation it was that the docker-entrypoint.sh script used "#!/bin/bash" as its shell and it doesn't exist in Docker alpine images.
I changed it to #!/bin/sh and problems resolved.

On my case I need to run
docker-compose -d up --build
To rebuild images and download the dockerize to my images, Solved my problem

For me the solution was ENTRYPOINT ["./entrypoint.sh"] vs ENTRYPOINT ["entrypoint.sh"].

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mcnesium picture mcnesium  路  3Comments

phanikumarp picture phanikumarp  路  3Comments

moyuan picture moyuan  路  3Comments

AndriiOmelianenko picture AndriiOmelianenko  路  4Comments

rap2hpoutre picture rap2hpoutre  路  3Comments