One of the ideas behind Docker containers is that you create a sandbox environment segregated from the host environment in such a way that the configuration of the container can be guaranteed. However, when planning a Docker deployment, it can be useful to log into the container to troubleshoot unforeseen issues. As long as the lessons learned get conveyed into the Dockerfile and the image is rebuilt, then the original containerization intent can be achieved.
# show full id
sudo docker ps --notrunc
# use lxc-attach
sudo lxc-attach -n <full-id>
NOTE: The recent release of Docker v0.9 requires a modification to /etc/init/docker.conf to allow lxc-attach. Set DOCKER_OPTS to " -e lxc".
Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer