Danushka Gunawardena
Danushka Gunawardena

Reputation: 1269

How to fix "Cannot start service pgsql: b'OCI runtime create failed:" when trying to up a pgsql container?

I get the following

ERROR: for marx_pgsql_1 Cannot start service pgsql: b'OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"/docker-entrypoint.sh\": permission denied": unknown'

when i try to fire up a pgsql alpine docker image.

Here is my 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

How do we fix this ?

Upvotes: 0

Views: 2122

Answers (1)

LinPy
LinPy

Reputation: 18578

I think the script docker-entrypoint.sh is not executable , I suggest to do the following:

create a Dockerfile:

FROM yobasystems/alpine-postgres:latest
RUN chmod +x docker-entrypoint.sh

update your docker-compose:

pgsql:
  build: .
  environment:
    POSTGRES_DB: bookmarx
    POSTGRES_USER: admin
    POSTGRES_PASSWORD: password
  expose:
    - "5432"
  volumes:
    - ./data:/var/lib/postgresql/data
  restart: always

Upvotes: 2

Related Questions