Podman 操作指令筆記

執行Container

# podman run --name pgadmin4 -p 8080:80/tcp -v /etc/localtime:/etc/localtime -e "PGADMIN_DEFAULT_EMAIL=admin" -e "PGADMIN_DEFAULT_PASSWORD=12qwaszx" -d --restart=on-failure:10 docker.io/dpage/pgadmin4

查詢目前正在執行的Container

# podman ps -a           
CONTAINER ID  IMAGE                          COMMAND     CREATED        STATUS            PORTS                 NAMES
980a8858adbb  docker.io/dpage/pgadmin4:6.14              3 seconds ago  Up 2 seconds ago  0.0.0.0:8080->80/tcp  pgadmin4

查詢Container Log內容

# podman logs 0ddbb9480591
'admin' does not appear to be a valid email address. Please reset the PGADMIN_DEFAULT_EMAIL environment variable and try again.

移除Container

# podman container rm -fa
0ddbb948059183982d69d3acccc904b18baabdb6144c7dda72eb91dfecc41747

匯出Images存成tar檔

# podman save -o pgadmin4.tar 4d5afde0a02e
# ls -l
total 753808
-rw-r--r--    1 aaaa  staff  375672832 Jan 11 15:32 pgadmin4.tar

從tar檔匯入Images

# podman load -i pgadmin4.tar     
Loaded image: sha256:4d5afde0a02ec3d9ede87df8825d82f76eb85ff127adc2b6976c379e6eb91bc9

# podman images              
REPOSITORY  TAG         IMAGE ID      CREATED      SIZE
<none>      <none>      4d5afde0a02e  3 weeks ago  376 MB

修改images repository資訊

# podman image tag 4d5afde0a02e dpage/pgadmin4:6.14
# podman images                                    
REPOSITORY                TAG         IMAGE ID      CREATED      SIZE
localhost/dpage/pgadmin4  6.14        4d5afde0a02e  3 weeks ago  376 MB

查詢podman 網卡相關資訊

--顯示podman 網卡
# podman network ls
NAME    VERSION  PLUGINS
podman  0.4.0    bridge,portmap,firewall,tuning

--podman網卡設定檔位置
# ls -l /etc/cni/net.d/
total 4
-rw-r--r--. 1 root root 639 Jan 13 11:16 87-podman-bridge.conflist

--顯示網卡設定內容
# podman network inspect podman
[
    {
        "cniVersion": "0.4.0",
        "name": "podman",
        "plugins": [
            {
                "bridge": "cni-podman0",
                "hairpinMode": true,
                "ipMasq": true,
                "ipam": {
                    "ranges": [
                        [
                            {
                                "gateway": "10.88.0.1",
                                "subnet": "10.88.0.0/16"
                            }
                        ]
                    ],
                    "routes": [
                        {
                            "dst": "0.0.0.0/0"
                        }
                    ],
                    "type": "host-local"
                },
                "isGateway": true,
                "type": "bridge"
            },
            {
                "capabilities": {
                    "portMappings": true
                },
                "type": "portmap"
            },
            {
                "type": "firewall"
            },
            {
                "type": "tuning"
            }
        ]
    }
]

張貼留言

0 留言