Created
May 26, 2016 10:27
-
-
Save tiagotex/0305294c980e800e7197093b615eb495 to your computer and use it in GitHub Desktop.
Access docker container running in EBS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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