Scenarios
This document demonstrates how to perform operations such as pulling, building, pushing, or running an image in a dev machine.
Using Podman in a Dev Machine
The Podman tool has been built in the dev machine to perform basic image operations. The commands for using Podman are basically consistent with those for using Docker.
Logging In to an Image Repository
# Log in to a private image repository.podman login <registry-url> -u <username> -p <password># Example:podman login tione.tencentcloudcr.com --username ******* --password ******
Pulling an Image
# Pull an image from a repository.podman pull <image-name>:<tag># Example:podman pull tione.tencentcloudcr.com/tione-public-images/notebook-conda-cpu:ubuntu22.04-miniforge3-py38
The process of pulling an image may require a large amount of disk space. If the node where the dev machine is located has a local data disk, it is recommended to mount the local data disk before pulling the image:
Create or edit the dev machine and mount the local data disk to a container.

Modify the graphroot storage path of the image layer or container read-write layer in the storage configuration file. For details, see Modifying Key Configurations of Podman.
Viewing an Image
# List local images.podman images# View the details of an image.podman inspect <image-id|image-name># Example:podman inspect tione.tencentcloudcr.com/tione-public-images/notebook-conda-cpu:ubuntu22.04-miniforge3-py38
Building an Image
To reduce storage usage, it is recommended to build an image in stages.
# Build an image using a Dockerfile.podman build -t <image-name>:<tag> <context-path># Example:podman build -t myapp:1.0 .
Pushing an Image
# Tag an image.podman tag <local-image> <registry>/<repository>:<tag># Push the image to a repository.podman push <registry>/<repository>:<tag># Example:podman tag myapp:1.0 registry.example.com/myteam/myapp:1.0podman push registry.example.com/myteam/myapp:1.0
Running a Container
Currently, the feature of specifying a GPU to run an image is not supported.
# Run a container.podman run [options] <image-name># Options: -d: run a container in the backend; -v: run a container on a volume mount; --name: specify a container name.# Example:podman run -d --name myContainer tione.tencentcloudcr.com/tione-public-images/notebook-conda-cpu:ubuntu22.04-miniforge3-py38# View the running containers. Options: -a: Include the stopped containers.podman ps
Deleting an Image or a Container
# Delete an image.podman rmi -f <image ID or name> # -f means forced deletion.podman image prune -a # -a: Delete unreferenced images.# Delete a container.podman rm -f <container ID or name> # -f means forced deletion.podman container prune # Delete all exited containers.# If the Podman storage is corrupted or needs to be completely cleaned up, you can directly delete the graphroot and runroot directories.# Example: rm -rf /var/lib/containers/storage/.
Modifying Key Configurations of Podman
Path of the storage configuration file: /etc/containers/storage.conf.
# Temporary storage path of a container runtime.runroot = "/var/run/containers/storage"# Storage path of the image layer or container read-write layer.graphroot = "/var/lib/containers/storage"