用于检查Docker容器文件系统内容的工具。
containerutil的Python项目详细描述
containerutil.Path为检查提供类似于pathlib.Path的api docker container文件系统:
importdockerimportcontainerutilclient=docker.from_env(version='auto')ctnr=client.containers.get('my-container')p=containerutil.Path(ctnr,'/foo/bar/path')p.exists()# True if file exists (regardless of type)p.is_file()# True if file exists and is a regular filep.is_symlink()# True if file exists and is a symbolic linkp.is_fifo()# True if file is a named pipe (FIFO)
安装
从PyPI使用pip包管理器:
pip install --upgrade containerutil
或者从github安装最新的源代码:
pip install https://github.com/pavdmyt/containerutil/archive/master.zip
开发
克隆存储库:
git clone https://github.com/pavdmyt/containerutil.git
安装依赖项:
make install
lint代码:
make lint
运行测试:
make test
贡献
- 叉开!
- 创建功能分支:git checkout -bmy-new-feature
- 提交更改:git commit -m 'Add some feature'
- 推到分支:git push origin my-new-feature
- 提交拉取请求
- 确保测试通过
许可证
麻省理工学院-Pavlo Dmytrenko