Docker compose & docker-entrypoint
\"./docker-entrypoint.sh\": permission denied": unknown
I would guess your docker-entrypoint.sh
doesn't have execute permissions (x
). But also docker-compose.yml
is not really the best place for the docker-entrypoint.sh
. It's the override setting, see entrypoint. The default should go in the Dockerfile
. Try this:
Add this to the end of your Dockerfile
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
The docker-entrypoint.sh
should be in the same folder as the Dockerfile
(or adjust the COPY
path). Remove the entrypoint
line from your docker-compose.yml
. Rebuild, rerun.
You may add "bash" in Entrypoint:
ENTRYPOINT ["bash","docker-entrypoint.sh"]
I spent a lot of time on this issue. the problem is that due the volume on the web service. I got the issue, because, I was docker-machine to deploy my app. Docker is using is using the volume which it does not find in the remote machine. Run the following to erase containers and volumes, which is the simple way to get rid of the issue.
docker-compose down -v
NB: Be cautious with the above command. Because, it delete all volume, therefore all the data you have on them.
The solution I use consists of docker a different docker-file and not adding volume to the web service.