Podman 使用

镜像查找

普通查找

podman search <search_term>

过滤查找

$ podman search httpd --filter=is-official
INDEX       NAME                      DESCRIPTION   STARS   OFFICIAL   AUTOMATED
docker.io   docker.io/library/httpd   docker.io     3103    [OK]

配置加速器

mv /etc/containers/registries.conf  /etc/containers/registries.conf.bak
touch /etc/containers/registries.conf
cat > /etc/containers/registries.conf <<EOF
unqualified-search-registries = ["docker.io"]
[[registry]]
prefix = "docker.io"
location = "eqcxmbvw.mirror.aliyuncs.com"
EOF

查看podman信息

$ podman info
host:
  arch: amd64
  buildahVersion: 1.15.0
  cgroupVersion: v1
  conmon:
    package: conmon-2.0.19-1.el7.x86_64
    path: /usr/bin/conmon
...

镜像下载

podman pull httpd

运行一个简单的容器

podman run -dt -p 80:80/tcp  httpd

查看镜像和容器

$ podman ps
CONTAINER ID  IMAGE                           COMMAND           CREATED         STATUS             PORTS               NAMES
27819727e377  docker.io/library/httpd:latest  httpd-foreground  40 seconds ago  Up 40 seconds ago  0.0.0.0:80->80/tcp  epic_driscoll

podman -h

可以看到,和docker的命令基本一致。

results matching ""

    No results matching ""