Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker exec is missing

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
like image 544
Max Avatar asked Dec 05 '14 16:12

Max


People also ask

What is Docker exec option?

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.

What is the difference between docker run and Docker exec?

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!

What is Docker exec container ID bin bash?

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.


Video Answer


2 Answers

Update docker on host.

docker exec was introduced on docker 1.3.0

like image 76
Fedalto Avatar answered Sep 29 '22 06:09

Fedalto


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
like image 22
christian Avatar answered Sep 29 '22 06:09

christian