博客
关于我
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/

你可能感兴趣的文章
nginx: [emerg] getpwnam(“www”) failed 错误处理方法
查看>>
nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:
查看>>
nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)
查看>>
nginx:Error ./configure: error: the HTTP rewrite module requires the PCRE library
查看>>
Nginx:objs/Makefile:432: recipe for target ‘objs/src/core/ngx_murmurhash.o‘解决方法
查看>>
nginxWebUI runCmd RCE漏洞复现
查看>>
nginx_rtmp
查看>>
Vue中向js中传递参数并在js中定义对象并转换参数
查看>>
Nginx、HAProxy、LVS
查看>>
nginx一些重要配置说明
查看>>
Nginx一网打尽:动静分离、压缩、缓存、黑白名单、跨域、高可用、性能优化......
查看>>
Nginx下配置codeigniter框架方法
查看>>
Nginx与Tengine安装和使用以及配置健康节点检测
查看>>
Nginx中使用expires指令实现配置浏览器缓存
查看>>
Nginx中使用keepalive实现保持上游长连接实现提高吞吐量示例与测试
查看>>
Nginx中如何配置WebSocket代理?
查看>>
Nginx中实现流量控制(限制给定时间内HTTP请求的数量)示例
查看>>
nginx中配置root和alias的区别
查看>>
nginx主要流程(未完成)
查看>>
Nginx之二:nginx.conf简单配置(参数详解)
查看>>