Enter in a Docker container already running with a new TTY?

0 votes
My container is running the Apache service in the foreground. I need to access the container from another shell in order to "poke around" inside it and examine the files. At the moment, I have left looking at the Apache daemon and unable to run any commands.

Is it possible to attach another tty to a running container? Possibly, I can take advantage of the fact that Docker is actually just wrapping around LXC containers? I have used sudo lxc-console -n [container-id] -t [1-4] but it appears that only one tty is made available and that is the one running the apache daemon. Perhaps there is a way to enable multiple lxc consoles during the build?
Oct 26, 2018 in Docker by Damon Salvatore
• 5,510 points
181 views

1 answer to this question.

0 votes

Here is what you can try.

For docker 1.3 and above, there is a new command docker exec. This allows you to enter a running docker container: 

docker exec -it [container-id] bash

I hope that this will work for you.

answered Oct 26, 2018 by shubham
• 6,890 points

Related Questions In Docker

0 votes
1 answer

How to continue running a docker container which is already exited?

Restart an existing container after you exited ...READ MORE

answered Jul 19, 2018 in Docker by Sophie may
• 9,870 points
131 views
0 votes
1 answer
0 votes
1 answer

Is it possible to start a shell session in a running container (without ssh)

use this docker exec -it "id of running ...READ MORE

answered Jul 25, 2018 in Docker by Kalgi
• 42,410 points
55 views
0 votes
1 answer

Is it possible to start a shell session in a running container (without ssh)

use this docker exec -it "id of running ...READ MORE

answered Jul 27, 2018 in Docker by Kalgi
• 42,410 points
53 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,920 points
227 views
+2 votes
6 answers
0 votes
1 answer

Unalble to pull a new container after upgrading Helm.

If there are changes to roll out, ...READ MORE

answered Apr 12, 2018 in Docker by shubham
• 6,890 points
77 views