Good day.
On the host machine was installed kernel 3.16. After installation the kernel 3.14 via deb package I lost all docker images and containers. Output of commands "docker images" and "docker ps -a" is empty. Is this normal behavior of docker?
Thanks.
The docker images, they are stored inside the docker directory: /var/lib/docker/ images are stored there.
No. Docker image/container only has the application layer of the OS and uses the kernel and CPU of the host machine. That's why docker container boot's so fast. In your host machine kernel is already running, so if you boot your docker container it will share the running kernel and start the container so fast.
Because containers share the same OS kernel as the host, containers can be more efficient than VMs, which require separate OS instances. Containers have better portability than other application hosting technologies: They can move among any systems that share the host OS type, without requiring code changes.
Listing Containers. In order to list the Docker containers, we can use the “docker ps” or “docker container ls” command. This command provides a variety of ways to list and filter all containers on a particular Docker engine.
I will answer myself. It may be useful someone.
Docker used storage driver "aufs" on the old kernel. Therefore the module "aufs.ko" must be loaded. In the new kernel support aufs was not be enabled and docker began to use storage driver "devicemapper".
To actually fix it on Ubuntu, run
sudo apt-get -y install linux-image-extra-$(uname -r)
This will install the aufs
kernel module that docker requires but can be lost during kernel upgrades. Not sure why the package manager misses this dependency.
As Denis Pitikov points out, images and containers can disappear if the storage driver that created them (e.g. aufs
) is no longer available.
When run on Ubuntu 14.04, the current Docker install script automatically installs the linux-image-extra-*
package (suitable for your current kernel version). This includes the aufs
kernel module.
On some systems, the linux-image-generic
package may not be installed. On these systems, the next time you run a dist-upgrade
, the kernel will be upgraded but the corresponding linux-image-extra-*
will not be installed. When you reboot you won't have the aufs
module, and your containers and images may have disappeared.
To fix it: first, check that you're running a generic kernel already:
$ uname -r
3.13.0-49-generic
If so, consider installing linux-image-generic
:
$ apt-get install linux-image-generic
That will upgrade your kernel to the version required by that package and will install the -extra
package too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With