👋 欢迎来到吴老二技术博客,专注运维 / 数据库 / 云原生
首页/云原生/正文

Podman简介以及基础使用

吴
吴老二
2021-04-01云原生10246 次浏览0 条评论
poman和docker一样,都是容器,只是Kubernetes的推广和完善的平台,把poman比下去了,不过针对poman也有类似Kubernetes的平台,只是推广的力度比较小,下面看看poman的使用。因为podman默认是使用的国外的镜像拉取,有点慢,所以需要修改成国内的镜像,这里选择阿里云的镜像拉取,下面是配置方法:
[root@www.wulaoer.org ~]# yum -y install podman
[root@www.wulaoer.org ~]# cp /etc/containers/registries.conf{,.bak}
[root@www.wulaoer.org ~]# cat > /etc/containers/registries.conf << EOF
unqualified-search-registries = ["docker.io"]
[[registry]]
prefix = "docker.io"
location = "uyah70su.mirror.aliyuncs.com"
EOF
查看容器Ip
[root@www.wulaoer.org ~]# podman inspect --format='{{.NetworkSettings.IPAddress}}' nginx(容器名)
打包容器
[root@www.wulaoer.org ~]# podman container checkpoint <container_id> -e /tmp/checkpoint.tar.gz
恢复容器
[root@www.wulaoer.org ~]# podman container restore -i /tmp/checkpoint.tar.gz
进入容器
[root@www.wulaoer.org ~]# podman exec -it 497e43bbe6b2 /bin/bash
podman参数
[root@www.wulaoer.org ~]# yum install -y bash-completion | exit
[root@www.wulaoer.org ~]# podman 
attach       container    diff         export       help         images       inspect      login        mount        pod          pull         rm           save         stats        top          unpause      volume       
build        cp           events       generate     history      import       kill         logout       pause        port         push         rmi          search       stop         umount       varlink      wait         
commit       create       exec         healthcheck  image        info         load         logs         play         ps           restart      run          start        tag          unmount      version      
[root@www.wulaoer.org ~]# podman run -
Display all 110 possibilities? (y or n)
-a                             --cpu-quota                    --device-write-iops            --health-interval              -l                             --no-hosts                     --rm                           --tty
--add-host                     --cpu-rt-period                --disable-content-trust=false  --health-retries               --label                        --oom-kill-disable             --rootfs                       -u
--annotation                   --cpu-rt-runtime               --dns                          --health-timeout               --label-file                   --oom-score-adj                --runtime                      --uidmap
--attach                       --cpus                         --dns-option                   --help                         --log-driver                   -p                             --security-opt                 --ulimit
--blkio-weight                 --cpuset-cpus                  --dns-search                   --hostname                     --log-opt                      -P                             --shm-size                     --user
--blkio-weight-device          --cpuset-mems                  -e                             --http-proxy                   -m                             --pid                          --sig-proxy=false              --userns
--builtin-volume               --cpu-shares                   --entrypoint                   -i                             --mac-address                  --pids-limit                   --stop-signal                  --uts
-c                             -d                             --env                          --image-volume                 --memory                       --pod                          --stop-timeout                 -v
--cap-add                      --detach                       --env-file                     --init                         --memory-reservation           --privileged                   --subgidname                   --volume
--cap-drop                     --detach-keys                  --expose                       --init-path                    --memory-swap                  --publish                      --subuidname                   --volumes-from
--cgroup-parent                --device                       --gidmap                       --interactive                  --memory-swappiness            --publish-all                  --sysctl                       -w
--cidfile                      --device-read-bps              --group-add                    --ip                           --name                         --quiet                        --systemd                      --workdir
--conmon-pidfile               --device-read-iops             -h                             --ipc                          --network                      --read-only                    -t                             
--cpu-period                   --device-write-bps             --health-cmd                   --kernel-memory                --no-healthcheck               --read-only-tmpfs              --tmpfs
虽然我们在平时很少使用,或者几乎没有使用过,不过不要近,这个不影响我们学习另外一种容器的心态,不过在做兼职时,有遇到过政府架构使用过,至于为什么使用podman就不太清楚了,他们使用后因为交接不利所以才会出现这种后期无法维护都问题,多学点对自己没有坏处。。。。。。
文章底部广告位在后台「广告设置」填写广告代码后显示

评论 0

评论需 登录 后发表(注册并验证邮箱)。
还没有评论,来抢沙发~