github.com/spg/deis@v1.7.3/contrib/util/dshell (about)

     1  #!/bin/bash
     2  
     3  # Convenience script for getting a terminal session on a docker container.
     4  # Usage: ./dshell <continer name> <command>
     5  # Examples:
     6  # `./dshell deis-controller /bin/ls` lists the contents of the root home folder
     7  # `./dshell deis-controller` gives an interactive prompt
     8  # echo "ls" | `./dshell deis-controller` lists the contents of the root home folder
     9  
    10  ID=$(docker inspect $1 | python -c 'import json,sys;obj=json.load(sys.stdin);print obj[0]["ID"]')
    11  lxc-attach -n $ID $2