podman-container-command

podman-container-exits

# podman container run -d --name="first-con" ubuntu sleep 3400
# podman container exists first-con
# echo $?
0

# podman container exists second-con
# echo $?
1

podman-container-refresh

# podman ps
CONTAINER ID  IMAGE                            COMMAND     CREATED             STATUS                 PORTS  NAMES
ceab4d9c356d  docker.io/library/ubuntu:latest  sleep 3400  About a minute ago  Up About a minute ago         first-con

# podman container refresh
# podman ps
CONTAINER ID  IMAGE                            COMMAND     CREATED        STATUS            PORTS  NAMES
ceab4d9c356d  docker.io/library/ubuntu:latest  sleep 3400  2 minutes ago  Up 4 seconds ago         first-con

podman-container-prune

# podman container run -d --name="test-prune-1" ubuntu sleep 3400
# podman container run -d --name="test-prune-2" ubuntu sleep 3400
# podman container prune
# podman ps -a | grep test-prune | wc -l
0

podman-container-runlabel

# mkdir test && cd test
# vi Dockerfile
FROM docker.io/library/ubuntu:latest
LABEL RUN="date conmmand"
RUN date

# podman build -t runlabel-ubuntu .
STEP 1: FROM docker.io/library/ubuntu:latest
STEP 2: LABEL RUN="date conmmand"
--> e9406c8cc4a8d14cbaa8a5de1f2cd428fc566c466cc7891eea8856e595c3e3bb
STEP 3: FROM e9406c8cc4a8d14cbaa8a5de1f2cd428fc566c466cc7891eea8856e595c3e3bb
STEP 4: RUN date
Wed Jan 23 16:30:34 UTC 2019
--> e276fad47b2d541b60926fc58e825d3cb9d7736c0356f312f4cd4d6a3a7b1c91
STEP 5: COMMIT runlabel-ubuntu

# podman images | grep runlabel
localhost/runlabel-ubuntu                latest   e276fad47b2d   5 seconds ago        90 MB

# podman container runlabel --display run localhost/runlabel-ubuntu:latest
Command: date conmmand

你可能感兴趣的:(podman-container-command)