8 Troubleshooting #
8.1 Analyze container images with container-diff #
In case a custom Docker Open Source Engine container image built on top of the SLE base container image is not working as expected, the container-diff tool can help you analyze the image and collect information relevant for troubleshooting.
container-diff makes it possible to analyze image changes by computing differences between images and presenting the diff in a human-readable and actionable format. The tool can find differences in system packages, language-level packages, and files in a container image.
container-diff
can handle local container images (using
the prefix
daemon://
), images in a remote registry (using
the prefix
remote://
), and images saved as
.tar
archives. You can use
container-diff
to compute the diff between a local
version of an image and a remote version.
To install
container-diff
, run the
sudo zypper
in container-diff
command.
8.1.1 Basic container-diff commands #
The command
container-diff analyze
IMAGE
runs a standard analysis on a
single image. By default, it returns a hash and size of the container image.
For more information that can help you to identify and fix problems, use
the specific analyzers. Use the
--type
parameter to
specify the desired analyzer. Two of the most useful analyzers are
history
(returns a list of descriptions of how an image
layer was created) and
file
(returns a list of file
system contents, including names, paths, and sizes):
tux >
sudo container-diff analyze --type=history daemon:// IMAGEtux >
sudo container-diff analyze --type=file daemon:// IMAGE
To view all available parameters and their brief descriptions, run the
container-diff analyze --help
command.
Using the
container-diff diff
command, you can compare
two container images and examine differences between them. Similar to the
container-diff analyze
command,
container-diff
diff
supports several parameters. The example command below
compares two images and returns a list of descriptions of how IMAGE_2 was
created from IMAGE_1.
tux >
sudo container-diff diff daemon://
IMAGE_1
daemon://
IMAGE_2
--type=history
To view all available parameters and their brief descriptions, run the
container-diff diff --help
command.