Last Updated: September 11, 2016
·
5.66K
· vedanta

Execute bash inside a docker container the right way

#!/bin/bash
#connect to a container
echo "Connect to container instance : $1" docker exec -it $1 /bin/bash -c "export TERM=xterm; exec bash"