Check local Docker images

The check-images.sh script is used to list local Docker images with version information. It can be run from the root directory of the onecx-local-env repository.

Here is the command to list all Docker images (without any filter).

./check-images.sh
script check images.sh
Figure 1. List of local Docker images

The local Docker images can easily be updated using the script update-images.sh.

Available Flags

The script accepts several optional flags to customize its behavior. The available flags are:

-f

Image filter, see https://docs.docker.com/reference/cli/docker/image/ls/#filter

-h

Displays help information about the script and its available flags. If used then all other options are ignored.

-n <text>

Name filter, find images which have <text> into image name

Examples

List images with onecx in name

./check-images.sh   -n onecx
script check images.sh filter onecx
Figure 2. List of local OneCX Docker images

List images marked as dangling

Candidates for deletion

./check-images.sh   -f "dangling=true"

Understanding the Listing

OneCX Version Labelling

When building OneCX images, the version is set in the label samo.project.version. The value of this label is displayed in the listing as VERSION.

Outdated Images

Over time, local Docker images become outdated. Especially after updates, images with the tag "<none>" may be listed.

script check images.sh none images
Figure 3. List of outdated Docker images

Such images can be removed. The script update-images.sh can be used or native with

docker image rm <image-id>