我得到以下
错误:对于marx_pgsql_1无法启动服务pgsql:b'OCI运行时创建失败:container_linux.go:345:启动容器进程导致“exec:\” / docker-entrypoint.sh \”:权限被拒绝”:未知”
当我尝试启动pgsql Alpine docker镜像时。
这是我的docker-compose.yml
web:
image: nginx:1.17.1-alpine
ports:
- "80:80"
volumes:
- ./code:/code
- ./site.conf:/etc/nginx/conf.d/site.conf
links:
- php
php:
build: .
volumes:
- ./code:/code
links:
- pgsql
pgsql:
image: yobasystems/alpine-postgres:latest
environment:
POSTGRES_DB: bookmarx
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
expose:
- "5432"
volumes:
- ./data:/var/lib/postgresql/data
restart: always
我们该如何解决?
最佳答案
我认为脚本docker-entrypoint.sh
是不可执行的,我建议执行以下操作:
创建一个Dockerfile:
FROM yobasystems/alpine-postgres:latest
RUN chmod +x docker-entrypoint.sh
更新您的docker-compose:
pgsql:
build: .
environment:
POSTGRES_DB: bookmarx
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
expose:
- "5432"
volumes:
- ./data:/var/lib/postgresql/data
restart: always
关于postgresql - 如何修复 “Cannot start service pgsql: b' OCI运行时创建失败:“尝试启动pgsql容器时?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/57304555/