Execute command in linked docker container -


is there way posible exec command inside 1 docker container in linked docker container? don't want exec command host.

as long have access docker socket within container, can run command inside docker container, doesn't matter whether or not linked. example:

# run container , link `other` docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock \            --link other:other myimage bash -l bash$ docker exec --it other echo hello 

this works if link not specified.