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,870 points
60 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 10, 2018 by Damon Salvatore
• 5,490 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
• 37,320 points
33 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
• 37,320 points
32 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
41 views
0 votes
1 answer

How do I start a Docker container with a volume?

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

answered Jul 2 in Docker by Namik
• 740 points
21 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,160 points
98 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,490 points
1,439 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,490 points
54 views