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 27, 2018 in Docker by Damon Salvatore
• 5,980 points
2,021 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 27, 2018 by shubham
• 7,340 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
• 10,610 points
2,280 views
+2 votes
1 answer

How to link one running container with other running container in docker.

Hi @Yuvraj! Yes, this is possible. You can ...READ MORE

answered Dec 16, 2019 in Docker by Kalgi
• 52,360 points
1,736 views
0 votes
1 answer
+2 votes
1 answer
+2 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
• 58,090 points
2,466 views
+2 votes
6 answers

copy directories in docker container excluding any one directory

One of the way could be copy ...READ MORE

answered Dec 10, 2018 in Docker by Prateek
33,125 views
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
• 7,340 points
560 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP