博客
关于我
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总结及使用Docker创建nginx教程
查看>>
nginx报错:the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:128
查看>>
nginx报错:the “ssl“ parameter requires ngx_http_ssl_module in usrlocalnginxconfnginx.conf128
查看>>
nginx日志分割并定期删除
查看>>
Nginx日志分析系统---ElasticStack(ELK)工作笔记001
查看>>
Nginx映射本地json文件,配置解决浏览器跨域问题,提供前端get请求模拟数据
查看>>
nginx最最最详细教程来了
查看>>
Nginx服务器---正向代理
查看>>
Nginx服务器上安装SSL证书
查看>>
Nginx服务器基本配置
查看>>
Nginx服务器的安装
查看>>
Nginx标准配置文件(包括反向代理、大文件上传、Https证书配置、文件预览等)
查看>>
Nginx模块 ngx_http_limit_conn_module 限制连接数
查看>>
Nginx模块 ngx_http_limit_req_module 限制请求速率
查看>>
nginx添加模块与https支持
查看>>
nginx状态监控
查看>>
Nginx用户认证
查看>>
Nginx的location匹配规则的关键问题详解
查看>>
Nginx的Rewrite正则表达式,匹配非某单词
查看>>
Nginx的使用总结(一)
查看>>