### Configure Installation for Boot Startup Source: https://docs.podman.io/en/latest/markdown/podman-container.unit.5.html Include an `[Install]` section with `WantedBy=multi-user.target` to ensure a container unit starts automatically on system boot. ```ini [Install] WantedBy=multi-user.target ``` -------------------------------- ### Start a Podman Kube Service Source: https://docs.podman.io/en/latest/markdown/podman-kube.unit.5.html Example of how to start a systemd user service generated from a `.kube` unit file. ```bash systemctl --user start name.service ``` -------------------------------- ### Usage Summary Source: https://docs.podman.io/en/latest/_sources/markdown/podman-kube.unit.5.md.txt Example of starting a Podman Kubernetes service using systemctl. ```bash systemctl --user start name.service ``` -------------------------------- ### Installation of generated systemd unit files. Source: https://docs.podman.io/en/latest/_sources/markdown/podman-generate-systemd.1.md.txt This example shows how to install the generated systemd unit files by copying them to the appropriate systemd directory and then enabling them using `systemctl`. ```bash # Generated systemd files. $ podman pod create --name systemd-pod $ podman create --pod systemd-pod alpine top $ podman generate systemd --files --name systemd-pod # Copy all the generated files. $ sudo cp pod-systemd-pod.service container-great_payne.service /etc/systemd/system $ systemctl enable pod-systemd-pod.service Created symlink /etc/systemd/system/multi-user.target.wants/pod-systemd-pod.service -> /etc/systemd/system/pod-systemd-pod.service. Created symlink /etc/systemd/system/default.target.wants/pod-systemd-pod.service -> /etc/systemd/system/pod-systemd-pod.service. $ systemctl is-enabled pod-systemd-pod.service enabled ``` -------------------------------- ### Install Section for Auto-Starting Containers Source: https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html Add this section to a Podman unit file to ensure the container starts automatically on system boot. ```systemd unit file [Install] WantedBy=default.target ``` -------------------------------- ### Minimal Container Unit Example Source: https://docs.podman.io/en/latest/_sources/markdown/podman-container.unit.5.md.txt A basic example of a Podman container unit file, defining its description, image, execution command, and installation target. ```ini [Unit] Description=A minimal container [Container] Image=quay.io/centos/centos:latest Exec=sleep 60 [Install] WantedBy=multi-user.target ``` -------------------------------- ### Enabling Container on Boot Source: https://docs.podman.io/en/latest/_sources/markdown/podman-systemd.unit.5.md.txt Example of an [Install] section to ensure a container service starts automatically on system boot. WantedBy=default.target is a common target for services that should run when the system is ready. ```systemd-unit [Install] WantedBy=default.target ``` -------------------------------- ### Enable Container Autostart on Boot Source: https://docs.podman.io/en/latest/_sources/markdown/podman-container.unit.5.md.txt Include an `[Install]` section with `WantedBy=multi-user.target` to ensure the container starts automatically when the system boots into the multi-user runlevel. ```ini [Install] WantedBy=multi-user.target ``` -------------------------------- ### Start a Templated Container Instance Source: https://docs.podman.io/en/latest/_sources/markdown/podman-container.unit.5.md.txt Instantiate and start a templated container unit (e.g., `foo@bar.service`) using the `systemctl start` command. ```bash systemctl start foo@bar.service ``` -------------------------------- ### Example .containerignore with Exceptions Source: https://docs.podman.io/en/latest/_sources/markdown/podman-build.1.md.txt This example shows how to use lines starting with '!' in a .containerignore file to create exceptions to general exclusion rules, allowing specific files to be included even if they match a broader exclusion pattern. ```ignore *.doc !Help.doc ``` -------------------------------- ### Tmpfs Mount Example Source: https://docs.podman.io/en/latest/_sources/markdown/podman-create.1.md.txt Example of mounting a tmpfs filesystem with a specified size. ```bash type=tmpfs,tmpfs-size=512M,destination=/path/in/container ``` -------------------------------- ### Start a Pod by Name Source: https://docs.podman.io/en/latest/markdown/podman-pod-start.1.html Use this command to start a pod when you know its name. ```bash podman pod start mywebserverpod ``` -------------------------------- ### Generate and Install Systemd Unit Files Source: https://docs.podman.io/en/latest/markdown/podman-generate-systemd.1.html This snippet demonstrates the process of creating a Podman pod and container, generating their systemd unit files, copying them to the system-wide systemd directory, and enabling them to start automatically. ```bash # Generated systemd files. $ podman pod create --name systemd-pod $ podman create --pod systemd-pod alpine top $ podman generate systemd --files --name systemd-pod # Copy all the generated files. $ sudo cp pod-systemd-pod.service container-great_payne.service /etc/systemd/system $ systemctl enable pod-systemd-pod.service Created symlink /etc/systemd/system/multi-user.target.wants/pod-systemd-pod.service /etc/systemd/system/pod-systemd-pod.service. Created symlink /etc/systemd/system/default.target.wants/pod-systemd-pod.service /etc/systemd/system/pod-systemd-pod.service. $ systemctl is-enabled pod-systemd-pod.service enabled ``` -------------------------------- ### Drop-in Configuration File Example Source: https://docs.podman.io/en/latest/markdown/podman-container.unit.5.html Example of a drop-in configuration file for a container unit. ```text test.container.d/10-extra.conf ``` -------------------------------- ### Ramfs Mount Example Source: https://docs.podman.io/en/latest/_sources/markdown/podman-create.1.md.txt Example of mounting a ramfs filesystem with a specified size. ```bash type=ramfs,tmpfs-size=512M,destination=/path/in/container ``` -------------------------------- ### Volume Mount Example Source: https://docs.podman.io/en/latest/_sources/markdown/podman-create.1.md.txt Example of mounting a named volume. ```bash type=volume,destination=/path/in/container ``` -------------------------------- ### Artifact Mount Example Source: https://docs.podman.io/en/latest/_sources/markdown/podman-create.1.md.txt Example of mounting an artifact, specifying source and destination. ```bash type=artifact,src=quay.io/libpod/testartifact:20250206-single,dst=/data ``` -------------------------------- ### Example .containerignore File Source: https://docs.podman.io/en/latest/_sources/markdown/podman-build.1.md.txt This example demonstrates how to use Unix shell globs in a .containerignore file to exclude files and directories from the build context. It includes examples of basic exclusion and the use of the '**' wildcard. ```ignore # exclude this content for image */*.c **/output* src ``` -------------------------------- ### Glob Mount Example Source: https://docs.podman.io/en/latest/_sources/markdown/podman-create.1.md.txt Example of a glob mount, specifying source pattern and destination. ```bash type=glob,src=/usr/lib/libfoo*,destination=/usr/lib,ro=true ``` -------------------------------- ### Use `systemctl` to perform operations on generated installed unit files. Source: https://docs.podman.io/en/latest/_sources/markdown/podman-generate-systemd.1.md.txt This example demonstrates starting and stopping a pod using `systemctl` commands, and then verifying the pod's status with `podman pod ps`. It also shows how to check for root user pods. ```bash $ systemctl --user start pod-systemd-pod.service $ podman pod ps POD ID NAME STATUS CREATED # OF CONTAINERS INFRA ID 0815c7b8e7f5 systemd-pod Running 29 minutes ago 2 6c5d116f4bbe $ sudo podman ps # 0 Number of pods on root. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES $ systemctl stop pod-systemd-pod.service $ podman pod ps POD ID NAME STATUS CREATED # OF CONTAINERS INFRA ID 272d2813c798 systemd-pod Exited 29 minutes ago 2 6c5d116f4bbe ``` -------------------------------- ### Show all connection details in a comprehensive format Source: https://docs.podman.io/en/latest/_sources/markdown/podman-system-connection-list.1.md.txt This example displays all connection details using a custom Go template for a detailed output. ```bash $ podman system connection list --format "Name: {{.Name}}\nURI: {{.URI}}\nIdentity: {{.Identity}}\nDefault: {{.Default}}\nReadWrite: {{.ReadWrite}}\n---" Name: podman-machine-default URI: ssh://core@127.0.0.1:53298/run/user/501/podman/podman.sock Identity: /Users/ragm/.local/share/containers/podman/machine/machine Default: true ReadWrite: true --- Name: podman-machine-default-root URI: ssh://root@127.0.0.1:53298/run/podman/podman.sock Identity: /Users/ragm/.local/share/containers/podman/machine/machine Default: false ReadWrite: true --- ``` -------------------------------- ### Example Generated ExecStart Command Source: https://docs.podman.io/en/latest/_sources/markdown/podman-systemd.unit.5.md.txt Illustrates a sample 'ExecStart' command that Podman Quadlet might generate for a container that mounts a volume defined by a template Quadlet. ```shell ExecStart=/usr/bin/podman run ... -v my-name-%i:/mnt/path ... ``` -------------------------------- ### Start Web Server Container Source: https://docs.podman.io/en/latest/_sources/markdown/podman-quadlet-basic-usage.7.md.txt Deploy the web server container by copying its Quadlet file, reloading systemd, and starting the service for rootless or rootful environments. ```bash cp webserver.container ~/.config/containers/systemd/ systemctl --user daemon-reload systemctl --user start webserver.service ``` ```bash sudo cp webserver.container /etc/containers/systemd/ sudo systemctl daemon-reload sudo systemctl start webserver.service ``` -------------------------------- ### Bind Mount Example with Configuration Files Source: https://docs.podman.io/en/latest/_sources/markdown/podman-run.1.md.txt Demonstrates a bind mount using '--mount' to link a host configuration directory (/etc/config) into the container (/app/config). Changes in either location are reflected in the other. ```bash podman run --mount type=bind,src=/etc/config,dst=/app/config alpine cat /app/config/file.conf ``` -------------------------------- ### Start a build service Source: https://docs.podman.io/en/latest/_sources/markdown/podman-build.unit.5.md.txt Example of how to start a generated build service using systemctl. ```bash systemctl --user start myimage-build.service ``` -------------------------------- ### Start a Podman Container Service with systemd Source: https://docs.podman.io/en/latest/_sources/markdown/podman-container.unit.5.md.txt Demonstrates how to start a container service managed by systemd using the `systemctl` command. This is the typical way to interact with containers defined by `.container` unit files. ```bash systemctl --user start myimage-container.service ``` -------------------------------- ### Get Podman Info via API Source: https://docs.podman.io/en/latest/_static/api.html Retrieves Podman system information using the RESTful API. This example demonstrates how to use cURL to send a GET request to the '/libpod/info' endpoint. ```bash curl --unix-socket /run/podman/podman.sock http://d/v6.0.0/libpod/info ``` -------------------------------- ### Start and Verify Container Source: https://docs.podman.io/en/latest/markdown/podman-auto-update.1.html Start the systemd service generated from the Quadlet file and verify that the container is running using 'podman ps'. ```bash $ systemctl --user start sleep.service $ podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f8e4759798d4 registry.fedoraproject.org/fedora:latest sleep infinity 2 seconds ago Up 2 seconds systemd-sleep ``` -------------------------------- ### Templated Sleepy Container Example Source: https://docs.podman.io/en/latest/_sources/markdown/podman-systemd.unit.5.md.txt An example of a templated Quadlet file for a container that executes a sleep command. The '%i' in Exec will be replaced by the instance name specified when starting the service (e.g., 'foo@bar.service'). ```systemd-unit [Unit] Description=A templated sleepy container [Container] Image=quay.io/fedora/fedora Exec=sleep %i [Service] ``` -------------------------------- ### Initialize all containers. Source: https://docs.podman.io/en/latest/_sources/markdown/podman-init.1.md.txt Initialize all containers. ```bash $ podman init --all 9d2629dda7b9d4ca35c1fc63fa56592a08b9d5ab988b4301fddf16b623f676cc a9b78bcac97e131236930e3fa0be576e95ab89c96a7cb6fb1c821b772db9f623 9db345273719c14bc254f90ef2df24779193b42d68b1364c0914ca6f76cf5e9c ``` -------------------------------- ### Example .containerignore File Source: https://docs.podman.io/en/latest/markdown/podman-build.1.html This example demonstrates basic exclusion patterns using Unix shell globs. It excludes files ending in .c in subdirectories, files/directories starting with 'output' from any directory, and the 'src' directory and its contents. ```ignore # exclude this content for image */*.c **/output* src ``` -------------------------------- ### Example .containerignore with Exception Source: https://docs.podman.io/en/latest/markdown/podman-build.1.html This example shows how to use the `!` prefix to create exceptions to exclusion rules. All files ending in .doc are excluded, except for 'Help.doc'. ```ignore *.doc !Help.doc ``` -------------------------------- ### CPU Shares Example Source: https://docs.podman.io/en/latest/_sources/markdown/podman-pod-create.1.md.txt Demonstrates how CPU shares are distributed among containers with different share settings. ```bash Example: --cpu-shares=512 running one process, and another container --cpu-shares=1024 running two processes ``` -------------------------------- ### Image Mount Example Source: https://docs.podman.io/en/latest/_sources/markdown/podman-create.1.md.txt Example of mounting an image as a filesystem, specifying source image and destination. ```bash type=image,source=fedora,destination=/fedora-image,rw=true ``` -------------------------------- ### Get Info Source: https://docs.podman.io/en/latest/_static/api.html Retrieves comprehensive information about the system and libpod configuration. This includes details about the host, installed plugins, storage, and Podman version. ```APIDOC ## GET /libpod/info ### Description Returns information on the system and libpod configuration. ### Method GET ### Endpoint /libpod/info ### Responses #### Success Response (200) - **Info** (object) - Detailed system and configuration information. #### Error Response (500) - **Internal server error** ### Response Example (200) ```json { "host": { "arch": "string", "buildahVersion": "string", "cdiSpecDirs": [ "string" ], "cgroupControllers": [ "string" ], "cgroupManager": "string", "cgroupVersion": "string", "conmon": { "package": "string", "path": "string", "version": "string" }, "cpuUtilization": { "idlePercent": 0.1, "systemPercent": 0.1, "userPercent": 0.1 }, "cpus": 0, "databaseBackend": "string", "discoveredDevices": [ { "id": "string", "source": "string" } ], "distribution": { "codename": "string", "distribution": "string", "variant": "string", "version": "string" }, "emulatedArchitectures": [ "string" ], "eventLogger": "string", "freeLocks": 0, "hostname": "string", "idMappings": { "gidmap": [ { "container_id": 0, "host_id": 0, "size": 0 } ], "uidmap": [ { "container_id": 0, "host_id": 0, "size": 0 } ] }, "kernel": "string", "linkmode": "string", "logDriver": "string", "memFree": 0, "memTotal": 0, "networkBackend": "string", "networkBackendInfo": { "backend": "string", "defaultNetwork": "string", "dns": { "package": "string", "path": "string", "version": "string" }, "package": "string", "path": "string", "version": "string" }, "ociRuntime": { "name": "string", "package": "string", "path": "string", "version": "string" }, "os": "string", "pasta": { "executable": "string", "package": "string", "version": "string" }, "remoteSocket": { "exists": true, "path": "string" }, "rootlessNetworkCmd": "string", "rootlessPortForwarder": "string", "runtimeInfo": { "property1": null, "property2": null }, "security": { "apparmorEnabled": true, "capabilities": "string", "rootless": true, "seccompEnabled": true, "seccompProfilePath": "string", "selinuxEnabled": true }, "serviceIsRemote": true, "swapFree": 0, "swapTotal": 0, "uptime": "string", "variant": "string" }, "plugins": { "authorization": [ "string" ], "log": [ "string" ], "network": [ "string" ], "volume": [ "string" ] }, "registries": { "property1": null, "property2": null }, "store": { "containerStore": { "number": 0, "paused": 0, "running": 0, "stopped": 0 }, "graphDriverName": "string", "graphOptions": { "property1": null, "property2": null }, "graphRoot": "string", "graphRootAllocated": 0, "graphRootUsed": 0, "graphStatus": { "property1": "string", "property2": "string" }, "imageCopyTmpDir": "string", "imageStore": { "number": 0 }, "runRoot": "string", "transientStore": true, "volumePath": "string" }, "version": { "APIVersion": "string", "BuildOrigin": "string", "Built": 0, "BuiltTime": "string", "GitCommit": "string", "GoVersion": "string", "Os": "string", "OsArch": "string", "Version": "string" } } ``` ``` -------------------------------- ### Inspect the specified image for GraphDriver format specifier Source: https://docs.podman.io/en/latest/_sources/markdown/podman-inspect.1.md.txt This example demonstrates inspecting an image to get the name of its graph driver. ```bash # podman inspect a04 --format "{{.GraphDriver.Name}}" overlay ``` -------------------------------- ### Example with multi-subnet network and dynamic allocation Source: https://docs.podman.io/en/latest/_sources/markdown/podman-pod-create.1.md.txt This example shows how to configure a pod with static IPs from different subnets, with dynamic allocation for remaining subnets. ```bash podman network create --subnet 10.89.0.0/24 --subnet 10.90.0.0/24 mynet podman run --network mynet:ip=10.89.0.10,ip=10.90.0.20 alpine ``` -------------------------------- ### Restore the container with other port ranges from the exported file. Source: https://docs.podman.io/en/latest/_sources/markdown/podman-container-restore.1.md.txt This example demonstrates starting a container, checkpointing it, exporting the checkpoint, and then restoring it with different port mappings. ```bash $ podman run --rm -p 2345:80 -d webserver # podman container checkpoint -l --export=dump.tar # podman container restore -p 5432:8080 --import=dump.tar ``` -------------------------------- ### To view a pod's logs since a certain time Source: https://docs.podman.io/en/latest/_sources/markdown/podman-pod-logs.1.md.txt This example demonstrates how to view logs for a pod starting from a specific RFC3339 formatted timestamp. ```bash podman pod logs -t --since 2017-08-07T10:10:09.055837383-04:00 myserver-pod-1 ``` -------------------------------- ### Enable and Control Container Service with systemctl Source: https://docs.podman.io/en/latest/markdown/podman-generate-systemd.1.html Illustrates enabling and starting a single container's systemd unit file using `sudo systemctl start`. It shows the state of containers before and after starting the service, highlighting the creation of a new container instance. ```bash # Enable the service. $ sudo podman ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bb310a0780ae docker.io/library/alpine:latest /bin/sh 2 minutes ago Created busy_moser $ sudo systemctl start container-busy_moser.service $ sudo podman ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 772df2f8cf3b docker.io/library/alpine:latest /bin/sh 1 second ago Up 1 second distracted_albattani bb310a0780ae docker.io/library/alpine:latest /bin/sh 3 minutes ago Created busy_moser ``` -------------------------------- ### Create and Run Dependent Containers Source: https://docs.podman.io/en/latest/_sources/markdown/podman-run.1.md.txt Use '--requires' to specify dependency containers that must be running before the current container starts. This example shows a single and multiple dependencies. ```bash $ podman create --name container1 -t -i fedora bash $ podman run --name container2 --requires container1 -t -i fedora bash ``` ```bash $ podman create --name container1 -t -i fedora bash $ podman create --name container2 -t -i fedora bash $ podman run --name container3 --requires container1,container2 -t -i fedora bash ``` -------------------------------- ### To view all pod logs Source: https://docs.podman.io/en/latest/_sources/markdown/podman-pod-logs.1.md.txt This example shows how to view all logs for a pod, specifying a start time of 0 (effectively all logs) and providing the pod's name. ```bash podman pod logs -t --since 0 myserver-pod-1 ``` -------------------------------- ### Initialize and start a new Podman machine in one step. Source: https://docs.podman.io/en/latest/_sources/markdown/podman-machine-init.1.md.txt Initializes and immediately starts a new Podman machine. ```bash podman machine init --now ``` -------------------------------- ### Show container-modified files versus the container's image in JSON format Source: https://docs.podman.io/en/latest/_sources/markdown/podman-diff.1.md.txt This example demonstrates how to get the differences in JSON format, which is useful for programmatic processing. ```shell $ podman diff --format json myimage { "changed": [ "/usr", "/usr/local", "/usr/local/bin" ], "added": [ "/usr/local/bin/docker-entrypoint.sh" ] } ``` -------------------------------- ### JSON Formatted Stats for a Container Source: https://docs.podman.io/en/latest/markdown/podman-stats.1.html Outputs container statistics in JSON format, which is useful for programmatic processing or integration with other tools. This example shows how to get JSON output for a specific container without streaming. ```bash # podman stats --no-stream --format=json a9f80 [ { "id": "a9f807ffaacd", "name": "frosty_hodgkin", "cpu_percent": "--", "mem_usage": "3.092MB / 16.7GB", "mem_percent": "0.02%", "netio": "-- / --", "blocki": "-- / --", "pids": "2" } ] ``` -------------------------------- ### List Images via API Source: https://docs.podman.io/en/latest/_static/api.html Lists all images available on the Podman host using the RESTful API. This example uses cURL to send a GET request to the '/libpod/images/json' endpoint and pipes the output to 'jq' for pretty-printing. ```bash curl --unix-socket /run/podman/podman.sock -v 'http://d/v6.0.0/libpod/images/json' | jq ``` -------------------------------- ### Show machine configuration details Source: https://docs.podman.io/en/latest/_sources/markdown/podman-machine-inspect.1.md.txt This example uses the --format option to display the machine's name, state, and configuration preferences like Rootful and UserModeNetworking. ```bash $ podman machine inspect --format "{{.Name}}: {{.State}} (Rootful: {{.Rootful}}, User Networking: {{.UserModeNetworking}})" podman-machine-default: running (Rootful: false, User Networking: true) ``` -------------------------------- ### List system connections Source: https://docs.podman.io/en/latest/_sources/markdown/podman-system-connection-list.1.md.txt This example shows how to list all available system connections with their details. ```bash $ podman system connection list Name URI Identity Default ReadWrite deva ssh://root@example.com:/run/podman/podman.sock ~/.ssh/id_rsa true true devb ssh://user@example.com:/run/user/1000/podman/podman.sock ~/.ssh/id_rsa false true ``` -------------------------------- ### Apply Kubernetes YAML File to Kubernetes Source: https://docs.podman.io/en/latest/markdown/podman-kube-apply.1.html Deploys a Kubernetes YAML file to the default namespace in a Kubernetes cluster using a specified kubeconfig file. This example also shows how to verify the deployment with `kubectl get pods`. ```bash $ podman kube apply --kubeconfig /tmp/kubeconfig -f vol.yaml Deploying to cluster... Successfully deployed workloads to cluster! $ kubectl get pods NAME READY STATUS RESTARTS AGE vol-test-2-pod 1/1 Running 0 9m ``` -------------------------------- ### Apply Podman Volume and Container to Kubernetes Source: https://docs.podman.io/en/latest/markdown/podman-kube-apply.1.html Deploys a Podman volume and container to the default namespace in a Kubernetes cluster using a specified kubeconfig file. This example also shows how to verify the deployment with `kubectl get pods`. ```bash $ podman kube apply --kubeconfig /tmp/kubeconfig myvol vol-test-1 Deploying to cluster... Successfully deployed workloads to cluster! $ kubectl get pods NAME READY STATUS RESTARTS AGE vol-test-1-pod 1/1 Running 0 9m ``` -------------------------------- ### Generate systemd unit file for Kubernetes YAML Source: https://docs.podman.io/en/latest/markdown/podman-generate-systemd.1.html This example demonstrates how to use `podman-generate-systemd` in conjunction with systemd to run a Kubernetes YAML file. It involves escaping the YAML file path for systemd and then starting and checking the status of the `podman-kube@.service` unit. ```bash $ escaped=$(systemd-escape ~/workload.yaml) $ systemctl --user start podman-kube@$escaped.service $ systemctl --user is-active podman-kube@$escaped.service active ``` -------------------------------- ### Control Pod Lifecycle with systemctl Source: https://docs.podman.io/en/latest/markdown/podman-generate-systemd.1.html Demonstrates starting and stopping a Podman pod using `systemctl --user`. Shows how to verify the pod's status with `podman pod ps` and checks for root-level pods. ```bash $ systemctl --user start pod-systemd-pod.service $ podman pod ps POD ID NAME STATUS CREATED # OF CONTAINERS INFRA ID 0815c7b8e7f5 systemd-pod Running 29 minutes ago 2 6c5d116f4bbe $ sudo podman ps # 0 Number of pods on root. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES $ systemctl stop pod-systemd-pod.service $ podman pod ps POD ID NAME STATUS CREATED # OF CONTAINERS INFRA ID 272d2813c798 systemd-pod Exited 29 minutes ago 2 6c5d116f4bbe ``` -------------------------------- ### Apply Kubernetes YAML to Specific Namespace Source: https://docs.podman.io/en/latest/markdown/podman-kube-apply.1.html Deploys a Kubernetes YAML file to a specified namespace ('test1') in a Kubernetes cluster using a specified kubeconfig file. This example also shows how to verify the deployment in the target namespace with `kubectl get pods --namespace test1`. ```bash $ podman kube apply --kubeconfig /tmp/kubeconfig --ns test1 vol-test-3 Deploying to cluster... Successfully deployed workloads to cluster! $ kubectl get pods --namespace test1 NAME READY STATUS RESTARTS AGE vol-test-3-pod 1/1 Running 0 9m ``` -------------------------------- ### Start a container using systemd Source: https://docs.podman.io/en/latest/_sources/markdown/podman-generate-systemd.1.md.txt This snippet shows how to list containers, start a specific container using systemctl, and then verify it's running. ```bash sudo podman ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bb310a0780ae docker.io/library/alpine:latest /bin/sh 2 minutes ago Created busy_moser sudo systemctl start container-busy_moser.service sudo podman ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 772df2f8cf3b docker.io/library/alpine:latest /bin/sh 1 second ago Up 1 second distracted_albattani bb310a0780ae docker.io/library/alpine:latest /bin/sh 3 minutes ago Created busy_moser ``` -------------------------------- ### Initialize Podman Machine with USB Vendor/Product Passthrough Source: https://docs.podman.io/en/latest/markdown/podman-machine-init.1.html Initializes the default Podman machine with USB device passthrough specified by vendor and product IDs. This is only supported for QEMU Machines. ```bash $ podman machine init --usb vendor=13d3,product=5406 ``` -------------------------------- ### Start a Pod Source: https://docs.podman.io/en/latest/_static/api.html Starts a pod identified by its name or ID. Returns a 304 if the pod is already started. ```bash curl -X POST "http://podman.io/libpod/pods/{name}/start" ``` -------------------------------- ### Drop-in Configuration File Example Source: https://docs.podman.io/en/latest/_sources/markdown/podman-container.unit.5.md.txt Example of a drop-in configuration file name for a Podman container unit. ```text test.container.d/10-extra.conf ```