尝试启动 pgsql 容器时如何修复"Cannot start service pgsql: b'OCI runtime create failed:"?



我得到以下

错误:对于MARX_PGSQL_1无法启动服务PGSQL:B'OCI运行时创建失败:container_linux.go:345:启动容器进程引起的" exec:"/docker-entrypoint.sh " exc/p>

当我尝试启动PGSQL高山码头图像时。

这是我的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

相关内容

  • 没有找到相关文章

最新更新