embedshim 项目使用教程

embedshim 项目使用教程

embedshimProvide task runtime implementation with pidfd and eBPF sched_process_exit tracepoint to manage deamonless container with low overhead.项目地址:https://gitcode.com/gh_mirrors/em/embedshim

项目介绍

embedshim 是一个用于 Linux 的容器运行时插件,它可以在容器运行时(如 containerd)中作为插件使用,管理容器进程的生命周期,并允许在 containerd 重启后重新连接。该项目的主要设计目标是实现一个轻量级的 shim,用于监控容器进程,至少对于由 runC 类运行时创建的容器是重要的。

项目快速启动

克隆项目

首先,克隆 embedshim 项目到本地:

git clone https://github.com/fuweid/embedshim.git
cd embedshim

初始化子模块

更新并初始化子模块:

git submodule update --init --recursive

编译和安装

编译项目并安装:

make
sudo make install

替换本地 containerd

将编译好的 embedshim-containerd 替换本地 containerd:

sudo install bin/embedshim-containerd $(command -v containerd)
sudo systemctl restart containerd

检查插件

使用 ctr 工具检查插件状态:

ctr plugin ls | grep embed

应用案例和最佳实践

应用案例

embedshim 可以用于需要在 headless 模式下运行容器的场景,例如在无头服务器或嵌入式系统中运行容器。它支持容器的创建、启动、退出、删除和 OOM 事件的监控。

最佳实践

  • 监控容器进程:使用 embedshim 监控容器进程,确保在 containerd 重启后能够重新连接并继续管理容器。
  • 避免生产环境使用:目前 embedshim 仍在开发中,不建议在生产环境中使用。

典型生态项目

containerd

containerd 是一个行业标准的容器运行时,embedshim 作为其插件,扩展了 containerd 的功能,使其能够更好地管理容器进程的生命周期。

runC

runC 是一个根据 OCI 规范创建和运行容器的命令行工具,embedshim 与 runC 类运行时配合使用,提供更全面的容器监控和管理功能。

通过以上步骤和案例,您可以快速上手并了解 embedshim 项目的基本使用方法和应用场景。

embedshimProvide task runtime implementation with pidfd and eBPF sched_process_exit tracepoint to manage deamonless container with low overhead.项目地址:https://gitcode.com/gh_mirrors/em/embedshim

  • 14
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

邵娇湘

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值