Skip to content

Latest commit

 

History

History
127 lines (85 loc) · 6.36 KB

readme.md

File metadata and controls

127 lines (85 loc) · 6.36 KB

softprops/shiplift explain translate-svg

「 操控docker容器的一个 Rust 接口 」

中文 | english


校对 ✅

翻译的原文 与日期 最新更新 更多
commit ⏰ 2019-2-25 last 中文翻译

贡献

欢迎 👏 勘误/校对/更新贡献 😊 具体贡献请看

生活

If help, buy me coffee —— 营养跟不上了,给我来瓶营养快线吧! 💰


shiplift

Build Status crates.io MIT licensed Released API docs Master API docs

操控docker容器的一个 Rust 接口

安装

将以下内容添加到您的Cargo.toml文件

[dependencies]
shiplift = "0.4"

用法

与主机沟通

要使用 shiplift,首先,您必须拥有一个可随时能用的 docker 守护程序。通常,此守护程序进程可通过名为DOCKER_HOST的环境变量,指定 URL 解析。

let docker = shiplift::Docker::new();

如果您希望更明确,可用一种url.Url形式提供一个主机。

use shiplift::Docker;
use url::Url;

let docker = Docker::host(Url::parse("http://yourhost").unwrap());

例子

可以在此存储库中的示例目录,找到许多小的可运行示例程序。


  • images:镜像 》列出当前 Docker 主机上的 Docker 镜像
  • imagepull 》从现有镜像中提取并创建新的 Docker 镜像
  • imagesearch 》按术语搜索 Docker 镜像
  • imagebuild 》通过读取目标目录中的 docker file 生成新的镜像 build
  • imagedelete 》删除镜像
  • imageinspect 》从现有镜像中提取并创建新的 Docker 镜像



更新计划

  • give image pull chunked json a proper type

Doug Tangren(softprops)2015-2018