enter-container.sh 215 B

12345678910111213
  1. #!/bin/bash
  2. if [ $# -ne 1 ]
  3. then
  4. echo
  5. echo "Usage: $(basename $0) <container_name>"
  6. echo
  7. exit 1
  8. fi
  9. PID=$(docker inspect --format '{{.State.Pid}}' $1)
  10. nsenter --target $PID --mount --uts --ipc --net --pid