安装podman
[root@192 ~]# yum -y install podman
podman使用
[root@192 ~]# podman search busybox
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/library/busybox Busybox base image. 2415 [OK]
docker.io docker.io/radial/busyboxplus Full-chain, Internet enabled, busybox made f... 43 [OK]
docker.io docker.io/yauritux/busybox-curl Busybox with CURL 16
......
和docker不同的是镜像会跟上仓库的位置
[root@192 ~]# podman run -it docker.io/library/busybox /bin/sh
Trying to pull docker.io/library/busybox:latest...
Getting image source signatures
Copying blob 3cb635b06aa2 done
Copying config ffe9d497c3 done
Writing manifest to image destination
Storing signatures
/ #
//使用由 Nginx 维护并在 GitHub 上发布的 Dockerfile构建 Nginx Web 服务器
[root@192 ~]#podman build -t nginx https://git.io/Jf8ol
//此处的https://git.io/Jf8ol已失效,根据自己需求自行查找可用的dockerfile所在网址
[root@192 ~]# podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/library/busybox latest ffe9d497c324 6 days ago 1.46 MB
docker.io/library/nginx latest f652ca386ed1 11 days ago 146 MB
//登录
[root@192 ~]# docker login docker.io
-bash: docker: command not found
[root@192 ~]# podman login docker.io
Username: //用户名
Password: //密码
Login Succeeded! //登录成功
//上传镜像
[root@192 ~]# podman push docker.io/soumnswa/nginx:latest
podman run -dt -p 8080:8080/tcp -e HTTPD_VAR_RUN=/run/httpd -e HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \
-e HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \
-e HTTPD_CONTAINER_SCRIPTS_PATH= share/container-scripts/httpd/\
registry.fedoraproject.org/f29/httpd /usr/bin/run-httpd
[root@192 ~]# podman ps
CONTAINER ID IMAGE