Connect to a running Docker container on CoreOS using nsenter

With version 0.9, Docker has dropped LXC and moved to using their own libcontainer driver instead. This means that LXC is now optional and lxc-attach is no longer available on the latest CoreOS build.

I suppose I could install the LXC driver, etc. but I don't want to. Using 'docker attach' just seems to kill the container and hang. I'm not sure if it's a bug or if I'm doing something wrong.

However I did find that this hack works (for now)- 
  • 'docker ps' to get the container ID
  • 'docker inspect --format '{{.State.Pid}}'  $CONTAINERID' to get the PID
  • 'sudo nsenter --target $PID --mount --uts --ipc --net --pid' drops you into a console on the running container.


Comments

Popular posts from this blog

The Forecaster Brown Fan Club

Automated Testing with vncdotool (Not Headless, but Hairless)

How to Create a Pentaho Report Using the REST Client