9月 292019
 

安装

centos官方yum源目前更新至podman-1.4.4,距离最新的1.5并不太远,所以,centos7上直接yum install -y podman就行。

启动

podman search busybox

podman pull docker.io/library/busybox

podman run -it –rm busybox

查看相关进程:

进程分析:

  1. podman进程并没有立即退出
  2. podman进程也不是容器进程(2953)的祖先进程,
  3. conmon(2943)进程才是容器进程的父进程

通过execsnoop了解podman的基本逻辑:

  1. 首先,准备网络环境,通过iptables以及 containernetworking-plugins 实现
  2. 然后,通过conmon来借助runc启动容器进程

通过podman info 了解podman:

  1. 这里显示了buildah的版本号,podman和buildah是什么关系?buildah是制作镜像用的,应该是可以单独使用的,但是使用podman构建镜像的时候并没有调用buildah进程,难道编译到podman进程里面了?(事实却是如此:Podman uses Buildah’s golang API and can be installed independently from Buildah),参考:https://github.com/containers/libpod
    1. 虽然buidah也有run操作,也要容器的概念,但是这些和podman是不同的,buildah的run相当于dockerfile中的RUN,而容器也是一个短暂的状态
  2. conmon:
  3. registries: 允许有多个registry
  4. storage
    1. 存储驱动: overlay,docker已经默认overlay2了,podman为啥还不支持overlay2?
    2. 存储位置:/var/lib/containers/storage

podman远程连接

目前所有发行版并不带有该功能,通过varlink来实现的,原本只listen本地的unix socket,远程连接需要先走ssh通道,话说这个也无可厚非

Rootless

需要使用crun作为运行时,而不是runc,因为需要cgroup v2,runc不支持cgroup v2

https://github.com/containers/libpod/blob/master/docs/tutorials/rootless_tutorial.md

Skopeo

一个管理镜像仓库的工具

容器迁移

虽然可以设置一个检查点,保存到文件后,从另外一个机器上restore后,继续运行,但是,该模式从网络的角度来看,等待时间太长,或者根本就是中断的,而OpenStack中虚拟机的热迁移基本是无感知的;

测试发现,podman的checkpoint功能完成export功能都很难,尚未测试成功; 另外,如果容器中有僵尸进程,基本是export不了的

 Posted by at 下午 4:40

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据