How can I re-access a bash console in a Docker?
Im starting some python scripts on a DGX Server running a Nvidia Tensorflow docker. I've managed once to re enter the docker file, where I could see that the process was still running. However I couldn't see the new prints in the console anymore.
Is there a way I can run the docker e.g. a whole night and when I re enter it I can see my complete printed logs in the bash console?
docker console
add a comment |
Im starting some python scripts on a DGX Server running a Nvidia Tensorflow docker. I've managed once to re enter the docker file, where I could see that the process was still running. However I couldn't see the new prints in the console anymore.
Is there a way I can run the docker e.g. a whole night and when I re enter it I can see my complete printed logs in the bash console?
docker console
add a comment |
Im starting some python scripts on a DGX Server running a Nvidia Tensorflow docker. I've managed once to re enter the docker file, where I could see that the process was still running. However I couldn't see the new prints in the console anymore.
Is there a way I can run the docker e.g. a whole night and when I re enter it I can see my complete printed logs in the bash console?
docker console
Im starting some python scripts on a DGX Server running a Nvidia Tensorflow docker. I've managed once to re enter the docker file, where I could see that the process was still running. However I couldn't see the new prints in the console anymore.
Is there a way I can run the docker e.g. a whole night and when I re enter it I can see my complete printed logs in the bash console?
docker console
docker console
asked Nov 13 '18 at 17:22
Mr.Sh4nnonMr.Sh4nnon
6111
6111
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I think you are wanting logging. I have only done application logging but maybe this will help: https://docs.docker.com/engine/reference/commandline/logs/
$ docker logs [OPTIONS] CONTAINER
edit: Additional links:
log.rowanto.com/docker-console-logs-problem
docs.docker.com/config/containers/logging
Cool that helps! However, I'd be nice if the console stays open anyway. Is there no way to achieve this?
– Mr.Sh4nnon
Nov 13 '18 at 18:23
1
Do you want the console from where you started the docker container to stay open and display the logs? eg. docker run {image}
– Clayton Harbich
Nov 13 '18 at 18:28
Well yes, it is the same console. I have to connect to the server by ssh. Then I start my docker, and run my python script. When the SSH closes I can get back in the docker, but I can't "re-enter" my console.
– Mr.Sh4nnon
Nov 13 '18 at 18:31
1
I don't know how to handle this through SSH. Some helpful links might be: log.rowanto.com/docker-console-logs-problem docs.docker.com/config/containers/logging
– Clayton Harbich
Nov 13 '18 at 18:37
1
Thank you very much! I guess I'll do it that way :)
– Mr.Sh4nnon
Nov 13 '18 at 18:38
add a comment |
$ docker attach [CONTAINER ID]
did the job to re-enter my console over ssh. However as Clayton Harbich pointed out
$ docker logs [OPTIONS] CONTAINER ID
is what I needed without knowing. Re-entering the console with attach doesn't show the history of console entries. So with those two commands I was able to see what happened and can further observe the scripts process.
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%2f53286438%2fhow-can-i-re-access-a-bash-console-in-a-docker%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think you are wanting logging. I have only done application logging but maybe this will help: https://docs.docker.com/engine/reference/commandline/logs/
$ docker logs [OPTIONS] CONTAINER
edit: Additional links:
log.rowanto.com/docker-console-logs-problem
docs.docker.com/config/containers/logging
Cool that helps! However, I'd be nice if the console stays open anyway. Is there no way to achieve this?
– Mr.Sh4nnon
Nov 13 '18 at 18:23
1
Do you want the console from where you started the docker container to stay open and display the logs? eg. docker run {image}
– Clayton Harbich
Nov 13 '18 at 18:28
Well yes, it is the same console. I have to connect to the server by ssh. Then I start my docker, and run my python script. When the SSH closes I can get back in the docker, but I can't "re-enter" my console.
– Mr.Sh4nnon
Nov 13 '18 at 18:31
1
I don't know how to handle this through SSH. Some helpful links might be: log.rowanto.com/docker-console-logs-problem docs.docker.com/config/containers/logging
– Clayton Harbich
Nov 13 '18 at 18:37
1
Thank you very much! I guess I'll do it that way :)
– Mr.Sh4nnon
Nov 13 '18 at 18:38
add a comment |
I think you are wanting logging. I have only done application logging but maybe this will help: https://docs.docker.com/engine/reference/commandline/logs/
$ docker logs [OPTIONS] CONTAINER
edit: Additional links:
log.rowanto.com/docker-console-logs-problem
docs.docker.com/config/containers/logging
Cool that helps! However, I'd be nice if the console stays open anyway. Is there no way to achieve this?
– Mr.Sh4nnon
Nov 13 '18 at 18:23
1
Do you want the console from where you started the docker container to stay open and display the logs? eg. docker run {image}
– Clayton Harbich
Nov 13 '18 at 18:28
Well yes, it is the same console. I have to connect to the server by ssh. Then I start my docker, and run my python script. When the SSH closes I can get back in the docker, but I can't "re-enter" my console.
– Mr.Sh4nnon
Nov 13 '18 at 18:31
1
I don't know how to handle this through SSH. Some helpful links might be: log.rowanto.com/docker-console-logs-problem docs.docker.com/config/containers/logging
– Clayton Harbich
Nov 13 '18 at 18:37
1
Thank you very much! I guess I'll do it that way :)
– Mr.Sh4nnon
Nov 13 '18 at 18:38
add a comment |
I think you are wanting logging. I have only done application logging but maybe this will help: https://docs.docker.com/engine/reference/commandline/logs/
$ docker logs [OPTIONS] CONTAINER
edit: Additional links:
log.rowanto.com/docker-console-logs-problem
docs.docker.com/config/containers/logging
I think you are wanting logging. I have only done application logging but maybe this will help: https://docs.docker.com/engine/reference/commandline/logs/
$ docker logs [OPTIONS] CONTAINER
edit: Additional links:
log.rowanto.com/docker-console-logs-problem
docs.docker.com/config/containers/logging
edited Nov 13 '18 at 18:53
answered Nov 13 '18 at 17:35
Clayton HarbichClayton Harbich
272313
272313
Cool that helps! However, I'd be nice if the console stays open anyway. Is there no way to achieve this?
– Mr.Sh4nnon
Nov 13 '18 at 18:23
1
Do you want the console from where you started the docker container to stay open and display the logs? eg. docker run {image}
– Clayton Harbich
Nov 13 '18 at 18:28
Well yes, it is the same console. I have to connect to the server by ssh. Then I start my docker, and run my python script. When the SSH closes I can get back in the docker, but I can't "re-enter" my console.
– Mr.Sh4nnon
Nov 13 '18 at 18:31
1
I don't know how to handle this through SSH. Some helpful links might be: log.rowanto.com/docker-console-logs-problem docs.docker.com/config/containers/logging
– Clayton Harbich
Nov 13 '18 at 18:37
1
Thank you very much! I guess I'll do it that way :)
– Mr.Sh4nnon
Nov 13 '18 at 18:38
add a comment |
Cool that helps! However, I'd be nice if the console stays open anyway. Is there no way to achieve this?
– Mr.Sh4nnon
Nov 13 '18 at 18:23
1
Do you want the console from where you started the docker container to stay open and display the logs? eg. docker run {image}
– Clayton Harbich
Nov 13 '18 at 18:28
Well yes, it is the same console. I have to connect to the server by ssh. Then I start my docker, and run my python script. When the SSH closes I can get back in the docker, but I can't "re-enter" my console.
– Mr.Sh4nnon
Nov 13 '18 at 18:31
1
I don't know how to handle this through SSH. Some helpful links might be: log.rowanto.com/docker-console-logs-problem docs.docker.com/config/containers/logging
– Clayton Harbich
Nov 13 '18 at 18:37
1
Thank you very much! I guess I'll do it that way :)
– Mr.Sh4nnon
Nov 13 '18 at 18:38
Cool that helps! However, I'd be nice if the console stays open anyway. Is there no way to achieve this?
– Mr.Sh4nnon
Nov 13 '18 at 18:23
Cool that helps! However, I'd be nice if the console stays open anyway. Is there no way to achieve this?
– Mr.Sh4nnon
Nov 13 '18 at 18:23
1
1
Do you want the console from where you started the docker container to stay open and display the logs? eg. docker run {image}
– Clayton Harbich
Nov 13 '18 at 18:28
Do you want the console from where you started the docker container to stay open and display the logs? eg. docker run {image}
– Clayton Harbich
Nov 13 '18 at 18:28
Well yes, it is the same console. I have to connect to the server by ssh. Then I start my docker, and run my python script. When the SSH closes I can get back in the docker, but I can't "re-enter" my console.
– Mr.Sh4nnon
Nov 13 '18 at 18:31
Well yes, it is the same console. I have to connect to the server by ssh. Then I start my docker, and run my python script. When the SSH closes I can get back in the docker, but I can't "re-enter" my console.
– Mr.Sh4nnon
Nov 13 '18 at 18:31
1
1
I don't know how to handle this through SSH. Some helpful links might be: log.rowanto.com/docker-console-logs-problem docs.docker.com/config/containers/logging
– Clayton Harbich
Nov 13 '18 at 18:37
I don't know how to handle this through SSH. Some helpful links might be: log.rowanto.com/docker-console-logs-problem docs.docker.com/config/containers/logging
– Clayton Harbich
Nov 13 '18 at 18:37
1
1
Thank you very much! I guess I'll do it that way :)
– Mr.Sh4nnon
Nov 13 '18 at 18:38
Thank you very much! I guess I'll do it that way :)
– Mr.Sh4nnon
Nov 13 '18 at 18:38
add a comment |
$ docker attach [CONTAINER ID]
did the job to re-enter my console over ssh. However as Clayton Harbich pointed out
$ docker logs [OPTIONS] CONTAINER ID
is what I needed without knowing. Re-entering the console with attach doesn't show the history of console entries. So with those two commands I was able to see what happened and can further observe the scripts process.
add a comment |
$ docker attach [CONTAINER ID]
did the job to re-enter my console over ssh. However as Clayton Harbich pointed out
$ docker logs [OPTIONS] CONTAINER ID
is what I needed without knowing. Re-entering the console with attach doesn't show the history of console entries. So with those two commands I was able to see what happened and can further observe the scripts process.
add a comment |
$ docker attach [CONTAINER ID]
did the job to re-enter my console over ssh. However as Clayton Harbich pointed out
$ docker logs [OPTIONS] CONTAINER ID
is what I needed without knowing. Re-entering the console with attach doesn't show the history of console entries. So with those two commands I was able to see what happened and can further observe the scripts process.
$ docker attach [CONTAINER ID]
did the job to re-enter my console over ssh. However as Clayton Harbich pointed out
$ docker logs [OPTIONS] CONTAINER ID
is what I needed without knowing. Re-entering the console with attach doesn't show the history of console entries. So with those two commands I was able to see what happened and can further observe the scripts process.
answered Nov 14 '18 at 9:31
Mr.Sh4nnonMr.Sh4nnon
6111
6111
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%2f53286438%2fhow-can-i-re-access-a-bash-console-in-a-docker%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