August 2018
Intermediate to advanced
352 pages
12h 30m
English
Add labels to the container's metadata by using the --label or -l option of the docker container run command, as follows:
$ docker container run \
--label com.example.container=docker-cookbook \
label-demo date
Let's start a container without a label and start two others with the same label:

Now, if we run docker container ls -a without any filter, it will list all the containers. However, we can limit the list of containers to those we labelled by applying filtering to the docker container ls -a command by using the --filter or -f option:
Read now
Unlock full access