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

你可能感兴趣的文章
npm安装crypto-js 如何安装crypto-js, python爬虫安装加解密插件 找不到模块crypto-js python报错解决丢失crypto-js模块
查看>>
npm安装教程
查看>>
npm报错Cannot find module ‘webpack‘ Require stack
查看>>
npm报错Failed at the node-sass@4.14.1 postinstall script
查看>>
npm报错fatal: Could not read from remote repository
查看>>
npm报错File to import not found or unreadable: @/assets/styles/global.scss.
查看>>
npm报错TypeError: this.getOptions is not a function
查看>>
npm报错unable to access ‘https://github.com/sohee-lee7/Squire.git/‘
查看>>
npm淘宝镜像过期npm ERR! request to https://registry.npm.taobao.org/vuex failed, reason: certificate has ex
查看>>
npm版本过高问题
查看>>
npm的“--force“和“--legacy-peer-deps“参数
查看>>
npm的安装和更新---npm工作笔记002
查看>>
npm的常用操作---npm工作笔记003
查看>>
npm的常用配置项---npm工作笔记004
查看>>
npm的问题:config global `--global`, `--local` are deprecated. Use `--location=global` instead 的解决办法
查看>>
npm编译报错You may need an additional loader to handle the result of these loaders
查看>>
npm设置淘宝镜像、升级等
查看>>
npm设置源地址,npm官方地址
查看>>
npm设置镜像如淘宝:http://npm.taobao.org/
查看>>
npm配置安装最新淘宝镜像,旧镜像会errror
查看>>