我是docker的初学者,由于容器重启问题,我被卡在了位。 当我尝试重新启动现有的退出容器或创建新容器(删除旧容器后)运行时,会发生问题:
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我的容器总是立即退出,状态为 Exited(1)
My container always exits immediately with status "Exited(1)"
我的容器日志有:
Inside the logs of my container i have:
但是我没有正在运行的PostgreSQL服务器
However I don't have any PostgreSQL server running at this moment.
推荐答案您需要终止该 postmaster 进程。
cat ... / postmaster.pid
此文件的第一个数字是 postmaster 进程的PID。
The first number of this file is the PID of postmaster process.
然后,使用以下命令终止该进程:
Then, kill that process using:
杀死PID
最后,运行一个容器,您的问题应该得到解决。
Finally, run a container, your problem should be fixed.
更多推荐
运行或重新启动PostgreSQL映像后,Docker容器立即退出
发布评论