summaryrefslogtreecommitdiffstats
path: root/roles/docker/files/enter-container.sh
blob: 7cf5b8d83a56a3ee6660fbdad60d1da02f49d481 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

if [ $# -ne 1 ]
then
  echo
  echo "Usage: $(basename $0) <container_name>"
  echo
  exit 1
fi

PID=$(docker inspect --format '{{.State.Pid}}' $1)

nsenter --target $PID --mount --uts --ipc --net --pid