Containers Flashcards
Explain what a container is and how to use one
A container is a set of one or more processes that are isolated from the rest of the system.
What 3 core technologies make up a container?
‣ Control Groups (cgroups) for resource management
‣ Namespaces for process isolation
‣ SELinux and Seccomp (Secure Computing mode) to enforce security boundaries
What are the 3 primary container tools used to manage, inspect and create containers?
‣ podman - directly manages containers and container images
‣ skopeo - inspects, copy, deletes and signs images
‣ buildah - creates new container images
Install container management tools and run a simple rootless container
yum module install container-tools
Start a rootless container
$ podman login registry.lab.example.com
$ podman pull registry.access.redhat.com/ubi8:latest
$ podman images
$ podman run -it registry.access.redhat.com/ubi8/ubi:latest
(-t is for –tty meaning pseudo-terminal)
(-i is for –interactive which means it accepts input)
(-d is for –detach which runs in the background)
Start a container named rhel8 with a bash terminal inside
$ podman run -it –name=rhel8 registry.access.redhat.com/ubi8/ubi /bin/bash
Run a container that removes itself once the command is completed
$ podman run –rm registry.access.redhat.com/ubi8/ubi cat /etc/os-release
Display container registry configuration
$ cat /etc/containers/registries.conf
or rootless is:
$ cat $HOME/.config/containers
(rootless settings override system)
Display podman configuration info
$ podman info
Find container images that start with “ubi” within a container registry
$ podman search registry.redhat.io/rhel8/ubi
or for longer descriptions:
$ podman search –notruc registry.access.redhat.com/rhel8/ubi
What is the offical Red Hat container catalog
https://access.redhat.com/containers
Inspect a remote container image
$ skopeo inspect docker://registry.redhat.io/rhel8/python-36
List locally stored container images
$ podman images
Inspect a locally stored container image
$ podman inspect registry.redhat.io/rhel8/python-38
Remove a locally stored container image
$ podman rmi registry.redhat.io/rhel8/python-36:latest