I have ubuntu 14.04 and it is missing docker exec
sudo docker exec -it ubuntu_bash bash
I wish to run interactive bash shell in existing running docker container.
sudo docker version
Client version: 1.0.1
Client API version: 1.12
Go version (client): go1.2.1
Git commit (client): 990021a
Server version: 1.0.1
Server API version: 1.12
Go version (server): go1.2.1
Git commit (server): 990021a
Description. The docker exec command runs a new command in a running container. The command started using docker exec only runs while the container's primary process ( PID 1 ) is running, and it is not restarted if the container is restarted. COMMAND will run in the default directory of the container.
Docker Run vs Docker Exec! This is a fairly common question – but has a simple answer! In short, docker run is the command you use to create a new container from an image, whilst docker exec lets you run commands on an already running container! Easy!
Docker Exec Bash The most popular usage of the “docker exec” command is to launch a Bash terminal within a container. In order to start a Bash shell in a Docker container, execute the “docker exec” command with the “-it” option and specify the container ID as well as the path to the bash shell.
Update docker on host.
docker exec
was introduced on docker 1.3.0
Updating docker with
apt-get update
apt-get install docker.io
didn't help on my system, as the ubuntu packges are quite old.
I have used
curl -sSL https://get.docker.com/ubuntu/ | sudo sh
(as describe here: http://docs.docker.com/installation/ubuntulinux/#docker-maintained-package-installation)
and got this update
docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8
OS/Arch (client): linux/amd64
Server version: 1.4.1
Server API version: 1.16
Go version (server): go1.3.3
Git commit (server): 5bc2ff8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With