EM

Untitled Flashcards Set

Q: What is the command to pull an image using Podman?
A: podman pull <imagename>

Q: What is the command to run an image using Docker?
A: docker run <imagename>

Q: How do you list all running containers in Podman?
A: podman container ls

Q: How do you list all containers (including stopped) in Docker?
A: docker container ls -a

Q: How do you view all downloaded images in Podman?
A: podman image ls

Q: What is the command to create a MySQL container with a specific database and user in Podman?
A: podman run --name mysql -d \

-p 3306:3306 \

-e MYSQL_ROOT_PASSWORD=root-pwd \

-e MYSQL_ROOT_HOST="%" \

-e MYSQL_DATABASE=mydb \

-e MYSQL_USER=remote_user \

-e MYSQL_PASSWORD=remote_user-pwd \

docker.io/library/mysql:8.4.4

Q: What does -d stand for in the Podman run command?
A: Detached mode (runs in the background).

Q: How do you log in to a running MySQL container in Podman?
A: podman exec -it mysql bash

Q: How can you preserve MySQL data in a volume?
A: Add -v ./data:/var/lib/mysql when running the container.

Q: What SQL command creates the "friends_tv_show" database?
A: CREATE DATABASE IF NOT EXISTS friends_tv_show;

Q: What does the "characters" table contain?
A: Character ID, First Name, Last Name, Actor Name, Date of Birth, Occupation, Apartment Number

Q: What command builds a Docker image using Podman?
A: podman build -t <username>/<repo_name>:<tag> .

Q: How do you tag an image for Docker Hub?
A: podman image tag <image_id> <username>/<repo>:latest

Q: How do you push a tagged image to Docker Hub?
A:podman push <username>/<repo>:1.0

podman push <username>/<repo>:latest

Q: How do you log into Docker Hub using Podman?
A: podman login docker.io

Q: What tool can you use to scan Docker images for vulnerabilities?
A: Trivy

Q: What Trivy command scans for high/critical vulnerabilities and outputs a table?
A:trivy image <image_name> --severity CRITICAL,HIGH --format table

Q: How can you save a Trivy scan result to a file?
A:trivy image <image_name> --severity CRITICAL,HIGH --output result.txt