How can I log into a running docker instance?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
poking docker
to see how it works:
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker run --net=host -d -t jmar71n/freepbx
2792243260a8de33d1a775d115188e601fc556e500b5ad085e09b4133d0f3d06
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker run -it jmar71n/freepbx bash
root@46f45b8973c3:/#
root@46f45b8973c3:/# exit
exit
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker run -it jmar71n/freepbx bash
root@813557bf8922:/#
root@813557bf8922:/# echo $PS1
[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@h:w$
root@813557bf8922:/#
Now, is each run
a new instance? Is that why the prompt changes? The hostname
is a unique ID for each run
?
How would I login to the first instance, with --net=host
?
When I try the exec flag, it fails:
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker exec -it jmar71n/freepbx bash
Error: No such container: jmar71n/freepbx
ubuntu@ip-172-31-14-19:~$
Why? What's the correct way to login to that instance?
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 20c44cd7596f 2 days ago 123MB
hello-world latest 725dcfab7d63 2 weeks ago 1.84kB
jmar71n/freepbx latest 8dda2a58fde1 19 months ago 1.54GB
ubuntu@ip-172-31-14-19:~$
docker hostname amazon-ec2 aws
add a comment |Â
up vote
1
down vote
favorite
poking docker
to see how it works:
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker run --net=host -d -t jmar71n/freepbx
2792243260a8de33d1a775d115188e601fc556e500b5ad085e09b4133d0f3d06
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker run -it jmar71n/freepbx bash
root@46f45b8973c3:/#
root@46f45b8973c3:/# exit
exit
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker run -it jmar71n/freepbx bash
root@813557bf8922:/#
root@813557bf8922:/# echo $PS1
[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@h:w$
root@813557bf8922:/#
Now, is each run
a new instance? Is that why the prompt changes? The hostname
is a unique ID for each run
?
How would I login to the first instance, with --net=host
?
When I try the exec flag, it fails:
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker exec -it jmar71n/freepbx bash
Error: No such container: jmar71n/freepbx
ubuntu@ip-172-31-14-19:~$
Why? What's the correct way to login to that instance?
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 20c44cd7596f 2 days ago 123MB
hello-world latest 725dcfab7d63 2 weeks ago 1.84kB
jmar71n/freepbx latest 8dda2a58fde1 19 months ago 1.54GB
ubuntu@ip-172-31-14-19:~$
docker hostname amazon-ec2 aws
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
poking docker
to see how it works:
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker run --net=host -d -t jmar71n/freepbx
2792243260a8de33d1a775d115188e601fc556e500b5ad085e09b4133d0f3d06
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker run -it jmar71n/freepbx bash
root@46f45b8973c3:/#
root@46f45b8973c3:/# exit
exit
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker run -it jmar71n/freepbx bash
root@813557bf8922:/#
root@813557bf8922:/# echo $PS1
[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@h:w$
root@813557bf8922:/#
Now, is each run
a new instance? Is that why the prompt changes? The hostname
is a unique ID for each run
?
How would I login to the first instance, with --net=host
?
When I try the exec flag, it fails:
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker exec -it jmar71n/freepbx bash
Error: No such container: jmar71n/freepbx
ubuntu@ip-172-31-14-19:~$
Why? What's the correct way to login to that instance?
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 20c44cd7596f 2 days ago 123MB
hello-world latest 725dcfab7d63 2 weeks ago 1.84kB
jmar71n/freepbx latest 8dda2a58fde1 19 months ago 1.54GB
ubuntu@ip-172-31-14-19:~$
docker hostname amazon-ec2 aws
poking docker
to see how it works:
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker run --net=host -d -t jmar71n/freepbx
2792243260a8de33d1a775d115188e601fc556e500b5ad085e09b4133d0f3d06
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker run -it jmar71n/freepbx bash
root@46f45b8973c3:/#
root@46f45b8973c3:/# exit
exit
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker run -it jmar71n/freepbx bash
root@813557bf8922:/#
root@813557bf8922:/# echo $PS1
[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@h:w$
root@813557bf8922:/#
Now, is each run
a new instance? Is that why the prompt changes? The hostname
is a unique ID for each run
?
How would I login to the first instance, with --net=host
?
When I try the exec flag, it fails:
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker exec -it jmar71n/freepbx bash
Error: No such container: jmar71n/freepbx
ubuntu@ip-172-31-14-19:~$
Why? What's the correct way to login to that instance?
ubuntu@ip-172-31-14-19:~$
ubuntu@ip-172-31-14-19:~$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 20c44cd7596f 2 days ago 123MB
hello-world latest 725dcfab7d63 2 weeks ago 1.84kB
jmar71n/freepbx latest 8dda2a58fde1 19 months ago 1.54GB
ubuntu@ip-172-31-14-19:~$
docker hostname amazon-ec2 aws
edited Nov 20 '17 at 12:21
asked Nov 20 '17 at 12:14
Thufir
634733
634733
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
accepted
Docker run, creates a new instance (para virtualised) environment from a given image.
To log in to a given instance, you need to run docker exec but you need to execute docker exec with the id of the container you are looking to log into. This can be attained from the command:
docker ps -a
Then with the id attained, log into the container with:
docker exec -it <containerid> bash
the<containerid>
is not running...tried a bunch. ?
â Thufir
Nov 20 '17 at 12:40
That then suggests an issue with the way the image has been built. There is probably an issue with the entry point.
â Raman Sailopal
Nov 20 '17 at 13:05
1
While both can be used for isolating processes, paravirtualization and containers are two very different technologies.
â Anthony Geoghegan
Nov 20 '17 at 14:13
ok, works fine. not sure what the prob was last time. thx.
â Thufir
Nov 22 '17 at 9:05
add a comment |Â
up vote
2
down vote
When you execute run
command, you create new container each time.
You execute run
with options -it
so you are being connected inside docker container, that's why your prompt is changing. So, all commands you execute with a new prompt will be executed inside the container.
When you say exit
you terminate your active process (bash since you pass it as a parameter during creation) and your container stops since it lives only as long as the main process with PID 1 lives.
In order to connect to the instance, first, run it with -d
in detached mode and then you can run docker attach
. docs You can get an ID of your container by docker ps -a
. Same with docker exec -it <containerID> bash
.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Docker run, creates a new instance (para virtualised) environment from a given image.
To log in to a given instance, you need to run docker exec but you need to execute docker exec with the id of the container you are looking to log into. This can be attained from the command:
docker ps -a
Then with the id attained, log into the container with:
docker exec -it <containerid> bash
the<containerid>
is not running...tried a bunch. ?
â Thufir
Nov 20 '17 at 12:40
That then suggests an issue with the way the image has been built. There is probably an issue with the entry point.
â Raman Sailopal
Nov 20 '17 at 13:05
1
While both can be used for isolating processes, paravirtualization and containers are two very different technologies.
â Anthony Geoghegan
Nov 20 '17 at 14:13
ok, works fine. not sure what the prob was last time. thx.
â Thufir
Nov 22 '17 at 9:05
add a comment |Â
up vote
0
down vote
accepted
Docker run, creates a new instance (para virtualised) environment from a given image.
To log in to a given instance, you need to run docker exec but you need to execute docker exec with the id of the container you are looking to log into. This can be attained from the command:
docker ps -a
Then with the id attained, log into the container with:
docker exec -it <containerid> bash
the<containerid>
is not running...tried a bunch. ?
â Thufir
Nov 20 '17 at 12:40
That then suggests an issue with the way the image has been built. There is probably an issue with the entry point.
â Raman Sailopal
Nov 20 '17 at 13:05
1
While both can be used for isolating processes, paravirtualization and containers are two very different technologies.
â Anthony Geoghegan
Nov 20 '17 at 14:13
ok, works fine. not sure what the prob was last time. thx.
â Thufir
Nov 22 '17 at 9:05
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Docker run, creates a new instance (para virtualised) environment from a given image.
To log in to a given instance, you need to run docker exec but you need to execute docker exec with the id of the container you are looking to log into. This can be attained from the command:
docker ps -a
Then with the id attained, log into the container with:
docker exec -it <containerid> bash
Docker run, creates a new instance (para virtualised) environment from a given image.
To log in to a given instance, you need to run docker exec but you need to execute docker exec with the id of the container you are looking to log into. This can be attained from the command:
docker ps -a
Then with the id attained, log into the container with:
docker exec -it <containerid> bash
edited Nov 20 '17 at 14:11
Thufir
634733
634733
answered Nov 20 '17 at 12:27
Raman Sailopal
1,18117
1,18117
the<containerid>
is not running...tried a bunch. ?
â Thufir
Nov 20 '17 at 12:40
That then suggests an issue with the way the image has been built. There is probably an issue with the entry point.
â Raman Sailopal
Nov 20 '17 at 13:05
1
While both can be used for isolating processes, paravirtualization and containers are two very different technologies.
â Anthony Geoghegan
Nov 20 '17 at 14:13
ok, works fine. not sure what the prob was last time. thx.
â Thufir
Nov 22 '17 at 9:05
add a comment |Â
the<containerid>
is not running...tried a bunch. ?
â Thufir
Nov 20 '17 at 12:40
That then suggests an issue with the way the image has been built. There is probably an issue with the entry point.
â Raman Sailopal
Nov 20 '17 at 13:05
1
While both can be used for isolating processes, paravirtualization and containers are two very different technologies.
â Anthony Geoghegan
Nov 20 '17 at 14:13
ok, works fine. not sure what the prob was last time. thx.
â Thufir
Nov 22 '17 at 9:05
the
<containerid>
is not running...tried a bunch. ?â Thufir
Nov 20 '17 at 12:40
the
<containerid>
is not running...tried a bunch. ?â Thufir
Nov 20 '17 at 12:40
That then suggests an issue with the way the image has been built. There is probably an issue with the entry point.
â Raman Sailopal
Nov 20 '17 at 13:05
That then suggests an issue with the way the image has been built. There is probably an issue with the entry point.
â Raman Sailopal
Nov 20 '17 at 13:05
1
1
While both can be used for isolating processes, paravirtualization and containers are two very different technologies.
â Anthony Geoghegan
Nov 20 '17 at 14:13
While both can be used for isolating processes, paravirtualization and containers are two very different technologies.
â Anthony Geoghegan
Nov 20 '17 at 14:13
ok, works fine. not sure what the prob was last time. thx.
â Thufir
Nov 22 '17 at 9:05
ok, works fine. not sure what the prob was last time. thx.
â Thufir
Nov 22 '17 at 9:05
add a comment |Â
up vote
2
down vote
When you execute run
command, you create new container each time.
You execute run
with options -it
so you are being connected inside docker container, that's why your prompt is changing. So, all commands you execute with a new prompt will be executed inside the container.
When you say exit
you terminate your active process (bash since you pass it as a parameter during creation) and your container stops since it lives only as long as the main process with PID 1 lives.
In order to connect to the instance, first, run it with -d
in detached mode and then you can run docker attach
. docs You can get an ID of your container by docker ps -a
. Same with docker exec -it <containerID> bash
.
add a comment |Â
up vote
2
down vote
When you execute run
command, you create new container each time.
You execute run
with options -it
so you are being connected inside docker container, that's why your prompt is changing. So, all commands you execute with a new prompt will be executed inside the container.
When you say exit
you terminate your active process (bash since you pass it as a parameter during creation) and your container stops since it lives only as long as the main process with PID 1 lives.
In order to connect to the instance, first, run it with -d
in detached mode and then you can run docker attach
. docs You can get an ID of your container by docker ps -a
. Same with docker exec -it <containerID> bash
.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
When you execute run
command, you create new container each time.
You execute run
with options -it
so you are being connected inside docker container, that's why your prompt is changing. So, all commands you execute with a new prompt will be executed inside the container.
When you say exit
you terminate your active process (bash since you pass it as a parameter during creation) and your container stops since it lives only as long as the main process with PID 1 lives.
In order to connect to the instance, first, run it with -d
in detached mode and then you can run docker attach
. docs You can get an ID of your container by docker ps -a
. Same with docker exec -it <containerID> bash
.
When you execute run
command, you create new container each time.
You execute run
with options -it
so you are being connected inside docker container, that's why your prompt is changing. So, all commands you execute with a new prompt will be executed inside the container.
When you say exit
you terminate your active process (bash since you pass it as a parameter during creation) and your container stops since it lives only as long as the main process with PID 1 lives.
In order to connect to the instance, first, run it with -d
in detached mode and then you can run docker attach
. docs You can get an ID of your container by docker ps -a
. Same with docker exec -it <containerID> bash
.
edited Dec 1 '17 at 9:01
answered Nov 20 '17 at 14:19
kirill-a
2,0351820
2,0351820
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405757%2fhow-can-i-log-into-a-running-docker-instance%23new-answer', 'question_page');
);
Post as a guest
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
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
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