[英]docker-entrypoint-initdb.d bad interpreter: Permission denied
Hi I a using postgres
docker-compose
in my application.嗨,我在我的应用程序中使用postgres
docker-compose
。 When I am trying to run it on my local machine (macOS Big Sur) I am getting below error and postgres
container exited.当我尝试在我的本地机器 (macOS Big Sur) 上运行它时,我遇到错误并且postgres
容器退出。
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/postgres-ssl.sh
/usr/local/bin/docker-entrypoint.sh: /docker-entrypoint-initdb.d/postgres-ssl.sh: /bin/bash: bad interpreter: Permission denied
Below is my docker-compose
下面是我的docker-compose
postgres:
build:
context: ./setup/postgres
dockerfile: ./Dockerfile
command:
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/ssl/certs/server.crt
-c ssl_key_file=/var/lib/postgresql/ssl/certs/server.key
-c ssl_ca_file=/var/lib/postgresql/ssl/certs/root.crt
ports:
- '5432:5432'
volumes:
- ./setup/postgres/scripts:/docker-entrypoint-initdb.d
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
Am I missing any steps here?我在这里遗漏了任何步骤吗?
I ended up running into this same issue.我最终遇到了同样的问题。 For anyone who faces this, you need to give execution permission to your script file, since Docker copies over permissions:对于任何面临这种情况的人,您需要授予脚本文件的执行权限,因为 Docker 会复制权限:
chmod +x your/script.sh
In my case the issue msg was:就我而言,问题味精是:
/opt/bitnami/scripts/libpostgresql.sh: /docker-entrypoint-initdb.d/my-initdb.sh: /bin/bash: bad interpreter: Permission denied
Then I gave execution permission to my-initdb.sh
and it worked nicely然后我给了my-initdb.sh
执行权限,它运行良好
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.