Podman Flashcards
(94 cards)
Search for images containing button
podman search button
Download images containing button
podman pull button
List local images
podman images
Run container ubi8/ubi:8.3 such that it prints ‘Hello word’
podman run ubi8/ubi:8.3 echo ‘Hello world!’
Explain the -d option
Run container image as a background process
Run bash on container ubi8/ubi:8.3
podman run -it ubi8/ubi:8.3 /bin/bash
Run MySQL with image: registry.redhat.io/rhel8/mysql-80
podman run –name mysql-custom \
> -e MYSQL_USER=redhat -e MYSQL_PASSWORD=r3dh4t \
> -e MYSQL_ROOT_PASSWORD=r3dh4t \
> -d registry.redhat.io/rhel8/mysql-80
Run container to set environment variable GREET and print it
podman run -e GREET=Hello -e NAME=RedHat \
> ubi8/ubi:8.3 printenv GREET NAME
Run bash on a running container
podman exec -it mysql-basic /bin/bash
Displays all actively running containers
podman ps
Displays all running and stopped containers
podman ps -a
Stop container my-httpd-container
podman stop my-httpd-container
Kill container
podman kill my-httpd-container
Restart container
podman restart my-httpd-container
Remove container
podman rm my-httpd-container
Restart container
podman restart my-httpd-container
Delete all containers
podman rm -a
Stop all containers
podman stop -a
Login to container registry
podman login registry.redhat.io
View container logs
podman logs mysql-db
Copy database file to mysql container.
podman cp ~/db.sql mysql:/
Execute sql query inplace in mysql container
podman exec mysql /bin/bash -c ‘mysql -uuser1 -pmypa55 -e “select * from items.Projects;”’
Explain podman unshare
provides a session to execute commands within the same user namespace as the process running inside the container
Example unshare command
podman unshare chown -R 27:27 /home/student/dbfiles