【问题标题】:LoadImage in podman with python3使用 python3 在 podman 中加载图像
【发布时间】:2020-08-27 23:36:01
【问题描述】:

我正在尝试在 podman 中加载我的 tar 映像。

Python 3.7.8 (default, Jun 29 2020, 05:46:05)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import podman
>>> c = podman.Client(uri='unix://var/run/docker.sock') #docker.sock is my mount point for podman socket
>>> c.
c.containers  c.images      c.pods        c.system
>>> c.images.
c.images.build(          c.images.get(            c.images.list(           c.images.search(
c.images.delete_unused(  c.images.import_image(   c.images.pull(
>>> c.images.

我没有看到任何加载图像的方法。 有没有像c.load_image("/tmp/se.tgz") 这样的方法? docker也有类似的方法,很容易实现。

【问题讨论】:

    标签: python-3.x podman


    【解决方案1】:

    有一个现有的 API 可以像这样使用。

    c = podman.Client(uri='unix://var/run/docker.sock')
    with c._client() as podman:
        results = podman.LoadImage("", "/tmp/se.tgz", False, False)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-11-25
      • 2013-09-16
      • 2019-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多