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 10, 2018 in Docker by shubham
• 6,480 points
49 views
have you got your answer?
Worked for me...thanks to @Damon

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
+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 10, 2018 by Damon Salvatore
• 5,250 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
• 35,640 points
21 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
• 35,640 points
16 views
0 votes
1 answer

How do i ssh into a running conatiner?

There is a docker exec command that ...READ MORE

answered Mar 12 in Docker by Jason
30 views
0 votes
1 answer
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,100 points
56 views
0 votes
1 answer

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

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

answered Aug 27, 2018 in Docker by Damon Salvatore
• 5,250 points
622 views
0 votes
1 answer

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,250 points
30 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.