How do I start a shell session in a running container without using ssh

+1 vote

I am trying to run the below command to run a bash shell within a running container :

docker run "container_id" /bin/bash

 I am getting this error :

2013/07/27 20:00:24 Internal server error: 404 trying to fetch remote history for 27d757283842

I want to run bash shell in a running container so do I have to run an SSH server in it and logging via ssh ?

Can anyone help me with this query?

Thanks.

Sep 11, 2018 in Docker by shubham
• 7,340 points
1,184 views
have you got your answer?
Worked for me...thanks to @Damon

1 answer to this question.

+1 vote
Here is what you can try.

you should use docker exec -it "containerid" bash

The answer to this question was:

If you really must and you are in a debug environment, you can do this: sudo lxc-attach -n <ID>Note that the id needs to be the full one

docker ps -notrunc

However, I strongly recommend against this.

also notrunc is deprecated, it's possible that it will get replaced by --no-trunc soon.

I hope the above explanation will help you resolve your query.

Thanks.
answered Sep 11, 2018 by Damon Salvatore
• 5,980 points

Related Questions In Docker

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
• 52,350 points
894 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
• 52,350 points
765 views
0 votes
2 answers

How do I start a container and create a volume using a volume driver?

You can first create the volume and ...READ MORE

answered Aug 6, 2019 in Docker by Sirajul
• 59,230 points
1,642 views
0 votes
2 answers

How do i ssh into a running conatiner?

To bash into a running container,you could ...READ MORE

answered Aug 9, 2019 in Docker by Sirajul
• 59,230 points
1,224 views
+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,020 points
2,706 views
+1 vote
2 answers

How do I copy a file from docker container to host?

Here is a way which you can ...READ MORE

answered Aug 28, 2018 in Docker by Damon Salvatore
• 5,980 points
28,569 views
+1 vote
2 answers

How do I run a docker image as a container?

You can run an image depends on whether you ...READ MORE

answered Sep 7, 2018 in Docker by Damon Salvatore
• 5,980 points
1,596 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