Kev's Site
  • Home
  • Games
  • Categories
  • Tags
  • About

#Docker

Useful Docker Commands

December 2, 2016

These are a bunch of docker commands that I find useful for keeping things tidy. Remove all orphaned images. These are the images tagged as <none>. docker images -q --filter "dangling=true" | xargs docker rmi Delete/remove all stopped containers. Note that -v option; it will also delete any persistent volumes that belong to the stopped containers. docker ps -aq --filter "status=exited" | xargs docker rm -v && docker ps -aq --filter "status=created"
Read More

Console access into a running Docker container

August 5, 2014

Sometimes, when setting up and debugging a container it is extremely useful to be able to ‘shell into’ the container to get a closer look at what’s going on. This is a quick guide on how to get shell console access into a running Docker container. UPDATE. If you are running docker version 1.3 or greater then you should use docker exec instead (see docker man pages for more info). The only use case that still requires the use of nsenter is where the user assigned to the container prevents you from doing tasks inside.
Read More

Install nsenter from source

August 5, 2014

nsenter is a great command line tool for accessing docker containers. Unfortunately it isn’t available in Ubuntu 14.04 at the time of writing. Fortunately building it from source is quite simple. Get the latest version of util-linux from kernel.org https://www.kernel.org/pub/linux/utils/util-linux/ At the time of writing the latest version was v2.25, which is the version used in the examples here. Install the build dependencies sudo apt-get install build-essential libncurses5-dev libslang2-dev gettext zlib1g-dev \ libselinux1-dev debhelper lsb-release pkg-config po-debconf autoconf \ automake autopoint libtool python2.
Read More

 © 2009 - 2025 Kevin Ellis