Manage containers Flashcards Preview

RHCSAv8.2 > Manage containers > Flashcards

Flashcards in Manage containers Deck (21)
Loading flashcards...
1

how to search for container image from a specific registry

podman search --no-trunc registry.access.redhat.com/rhel8

--no-trunc gives more detailed information about the image

2

how to search for a container image

podman search rhel8

3

how to get the current container image from a specific repository

podman pull registry.access.redhat.com/ubi8/ubi:latest

registry_name/user_name/image_name:tag

4

where is the config file that podman uses to keep track of registries

/etc/containers/registries.conf

5

what command will display the current configuration for podman

podman info

6

how to inspect container image using podman

podman inspect registry.redhat.io/rhel8/python-36

7

how to inspect container image using skopeo

skopeo inspect docker://registry.redhat.io/rhel8/python-36

8

how to list all the container images on the system

podman images

9

how to remove a specific container image

podman rmi registry.redhat.io/rhel8/python-36:latest

10

how to view all current running containers

podman ps

11

how to view all containers that are either running or died

podman ps -a

12

how to remove a specific container

podman rm httpd-24

13

how to kill a running container

podman kill -s SIGKILL httpd-24

14

how to run a container image in the background with a specified name and port forwarding

podman run -d -p 8000:8080 --name=httpd-24  registry.redhat.io/rhel8/httpd-24

15

how to restart a container

podman restart httpd-24

16

how to stop a container

podman stop httpd-24

17

how to get a bash shell in a running container

podman exec -it my_webserver /bin/bash

18

how to attach persistent storage to a container

podman run -d --name mydb -v /home/user/dbfiles:/var/lib/mysql:Z registry.redhat.io/rhel8/mariadb:latest

-v /folder/file/location/on/system:/location/in/container:Z (Z automatically applies the SELinux container_file_t context type)

19

how to configured a container to start on bootup running as a user (not root)

loginctl enable-linger
podman run -d --name web registry.redhat.io/rhel8/httpd-24:latest
podman generate systemd --name web --files --new
cp container-web.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable myapp.service
systemctl --user start myapp.service

20

how to configure a container to start on bootup (can be as root)

podman run -d --name web registry.redhat.io/rhel8/httpd-24:latest
podman generate systemd --name web --files --new
cp container-web.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable myapp.service
systemctl start myapp.service

21

how to start a container (not image)

podman start httpd-24