Docker container exits immediately after running o

2019-08-13 22:27发布

I am begginer with docker, and I stuck in place due to container restarting problem. The problem occures when I try to restart an existing exited container, or create new container (after deleting old one) running:

docker run -d --name mempostgres \
    -v "/home/lukasz/lc_pg_data:/var/lib/pgsql/data:Z" \
    -e POSTGRES_USER=postgres \
    -e POSTGRES_PASSWORD=password \
    -e POSTGRES_DB=dbName \
    -p 5432:5432 \
    fedora/postgresql

My container always exits immediately with status "Exited(1)"

Inside the logs of my container i have: enter image description here

However I don't have any PostgreSQL server running at this moment.

1条回答
Emotional °昔
2楼-- · 2019-08-13 22:54

You need to kill that postmaster process.

cat .../postmaster.pid

The first number of this file is the PID of postmaster process.

Then, kill that process using:

kill PID

Finally, run a container, your problem should be fixed.

查看更多
登录 后发表回答