博客
关于我
podman快速入门详解与实践
阅读量:782 次
发布时间:2019-03-24

本文共 811 字,大约阅读时间需要 2 分钟。

Podman简介

Podman最初是CRI-O项目的一部分,后来独立开发为libpod。它强调简单直接,不像Docker有daemon,直接通过OCI运行时(默认是runc)启动容器,这意味着容器进程是podman的子进程。这类似于Linux的fork/exec模型,而非传统的C/S(客户端/服务器)模式。相比之下,fork/exec模式在系统管理和cgroup限制方面有显著优势:

  • 系统管理员可以追踪容器进程来源
  • 可以将cgroup设置为限制所有podman容器
  • 支持SD_NOTIFY机制,在systemd服务中集成
  • 支持socket激活机制

与Docker的兼容性

Podman与Docker高度兼容:

  • 支持直接使用Docker镜像
  • 命令风格相似,甚至可以用Podman设置alias为docker

安装Podman

yum -y install podman

查看版本号

podman version

Podman默认网络模式

默认网段为10.88.0.1/16

(Command-line Options) 命令线选项

...

使用阿里云镜像加速

建议配置阿里云容器镜像以加速镜像访问。Podman的注册表配置文件位于/etc/containers/registries.conf。修改配置文件以实现加速:

unqualified-search-registries = ["docker.io"][[registry]]prefix = "docker.io"location = ".mirror.aliyuncs.com"

完成后,Podman拉取镜像会通过阿里云加速镜像服务。

拉取镜像并运行

下载镜像示例:

podman pull nginx

查看镜像:

podman images

运行镜像:

podman run -itd --name nginx -p 9999:80 f6d0b4767a6c

转载地址:http://ocgkk.baihongyu.com/

你可能感兴趣的文章
poj 2387 最短路模板题
查看>>
POJ 2391 多源多汇拆点最大流 +flody+二分答案
查看>>
POJ 2403
查看>>
poj 2406 还是KMP的简单应用
查看>>
POJ 2431 Expedition 优先队列
查看>>
Qt笔记——获取位置信息的相关函数
查看>>
POJ 2484 A Funny Game(神题!)
查看>>
POJ 2486 树形dp
查看>>
POJ 2488:A Knight's Journey
查看>>
SpringBoot为什么易学难精?
查看>>
poj 2545 Hamming Problem
查看>>
poj 2723
查看>>
poj 2763 Housewife Wind
查看>>
Qt笔记——模型/视图MVD 文件目录浏览器软件
查看>>
POJ 2892 Tunnel Warfare(树状数组+二分)
查看>>
poj 2965 The Pilots Brothers' refrigerator-1
查看>>
poj 3026( Borg Maze BFS + Prim)
查看>>
POJ 3041 - 最大二分匹配
查看>>
POJ 3041 Asteroids(二分匹配模板题)
查看>>
Qt笔记——标准文件对话框QFileDialog
查看>>