Manage containers Flashcards
how to search for container image from a specific registry
podman search –no-truncregistry.access.redhat.com/rhel8
–no-trunc gives more detailed information about the image
how to search for a container image
podman search rhel8
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
where is the config file that podman uses to keep track of registries
/etc/containers/registries.conf
what command will display the current configuration for podman
podman info
how to inspect container image using podman
podman inspect registry.redhat.io/rhel8/python-36
how to inspect container image using skopeo
skopeo inspect docker://registry.redhat.io/rhel8/python-36
how to list all the container images on the system
podman images
how to remove a specific container image
podman rmi registry.redhat.io/rhel8/python-36:latest
how to view all current running containers
podman ps
how to view all containers that are either running or died
podman ps -a
how to remove a specific container
podman rm httpd-24
how to kill a running container
podman kill -s SIGKILL httpd-24
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
how to restart a container
podman restart httpd-24
how to stop a container
podman stophttpd-24
how to get a bash shell in a running container
podman exec -it my_webserver /bin/bash
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)
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
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
how to start a container (not image)
podman start httpd-24