I have a service in the docker compose as follows.
nginx:
image: nginx:1.18.0-alpine
ports:
- 8000:80
volumes:
- ./nginx/localhost/conf.d:/etc/nginx/conf.d
- ./entrypoint.sh:/entrypoint.sh
entrypoint: ./entrypoint.sh
depends_on:
- webapp
networks:
- nginx_network
I get the error
Cannot start service nginx: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/entrypoint.sh": permission denied: unknown
ERROR: for nginx Cannot start service nginx: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/entrypoint.sh": permission denied: unknown
ERROR: Encountered errors while bringing up the project.
How can i do this
2
Answers
I have to use
["/bin/sh","/entrypoint.sh"]
I don’t have enough information about your entrypoint script, config file and the web app minimal information.
Sometimes when you create a file on your host machine it lacks some permissions to be executed by some users in your docker container, so Iwould think about checking the permissions for that file by running:
that will give you all permissions about that file, and maybe that’s why it’s telling you permission is denied try adding execution permission running
chmod +x ./entrypoint.sh
.dockerfile
docker-compose.yaml
Then try to run: