Docker container exits immediately after running or restarting PostgreSQL image
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:
However I don't have any PostgreSQL server running at this moment.
postgresql docker
add a comment |
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:
However I don't have any PostgreSQL server running at this moment.
postgresql docker
Not an answer but the image isn't really up to date. I would recommend to use the official postgres image: hub.docker.com/_/postgres
– lvthillo
Jun 12 '17 at 10:55
If you are sure that there is no another Postgres running, delete that .pid file.
– Robert
Jun 12 '17 at 11:35
add a comment |
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:
However I don't have any PostgreSQL server running at this moment.
postgresql 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
My container always exits immediately with status "Exited(1)"
Inside the logs of my container i have:
However I don't have any PostgreSQL server running at this moment.
postgresql docker
postgresql docker
edited Nov 20 '18 at 19:20
Massimiliano Kraus
2,34541532
2,34541532
asked Jun 12 '17 at 10:42
LucasPGLucasPG
1381114
1381114
Not an answer but the image isn't really up to date. I would recommend to use the official postgres image: hub.docker.com/_/postgres
– lvthillo
Jun 12 '17 at 10:55
If you are sure that there is no another Postgres running, delete that .pid file.
– Robert
Jun 12 '17 at 11:35
add a comment |
Not an answer but the image isn't really up to date. I would recommend to use the official postgres image: hub.docker.com/_/postgres
– lvthillo
Jun 12 '17 at 10:55
If you are sure that there is no another Postgres running, delete that .pid file.
– Robert
Jun 12 '17 at 11:35
Not an answer but the image isn't really up to date. I would recommend to use the official postgres image: hub.docker.com/_/postgres
– lvthillo
Jun 12 '17 at 10:55
Not an answer but the image isn't really up to date. I would recommend to use the official postgres image: hub.docker.com/_/postgres
– lvthillo
Jun 12 '17 at 10:55
If you are sure that there is no another Postgres running, delete that .pid file.
– Robert
Jun 12 '17 at 11:35
If you are sure that there is no another Postgres running, delete that .pid file.
– Robert
Jun 12 '17 at 11:35
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44497437%2fdocker-container-exits-immediately-after-running-or-restarting-postgresql-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
add a comment |
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.
add a comment |
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.
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.
edited Jun 12 '17 at 12:47
answered Jun 12 '17 at 11:49
kstromeiraoskstromeiraos
2,2661018
2,2661018
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44497437%2fdocker-container-exits-immediately-after-running-or-restarting-postgresql-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Not an answer but the image isn't really up to date. I would recommend to use the official postgres image: hub.docker.com/_/postgres
– lvthillo
Jun 12 '17 at 10:55
If you are sure that there is no another Postgres running, delete that .pid file.
– Robert
Jun 12 '17 at 11:35