Skip to content

Instantly share code, notes, and snippets.

@tiagotex
Created May 26, 2016 10:27
Show Gist options
  • Save tiagotex/0305294c980e800e7197093b615eb495 to your computer and use it in GitHub Desktop.
Save tiagotex/0305294c980e800e7197093b615eb495 to your computer and use it in GitHub Desktop.
Access docker container running in EBS
# Using nsenter you will be able to attach to a running docker container
# SSH into the EBS instance
# See what containers are running
docker ps
# Install nsenter
docker run -v /usr/local/bin:/target jpetazzo/nsenter
# Figure out the PID of the container you want to enter:
PID=$(docker inspect --format {{.State.Pid}} <container_name_or_ID>)
# Enter container:
nsenter --target $PID --mount --uts --ipc --net --pid
# You are now inside the running docker container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment