V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
wr410
V2EX  ›  Docker

请教一下, docker 如何删除一个镜像 image 的层 layer?

  •  
  •   wr410 · Jul 29, 2018 · 5395 views
    This topic created in 2828 days ago, the information mentioned may be changed or developed.
    事情是这样的,我制作了一个 image,通过 save 导出为 tar 包,然后把这个镜像通过 load 导入到另一台机子上。

    新的机子上,通过 docker history 查看到层的信息,但是除了最顶一层,其余的 ID 均为<missing>。

    所以看到资料说通过 tag 可以进行层的回滚,但是这里没有 ID 可用也就似乎无法使用 tag 命令了。

    按照我的理解,docker 的镜像应该是层的叠加而成的,那么进行回滚时理论上也应该可以逐层回滚吧?

    所以,我想问的是,我导入的镜像,如何进行层的回滚?
    1 replies    2018-07-30 21:13:52 +08:00
    Keller0
        1
    Keller0  
       Jul 30, 2018   ❤️ 1
    在 build 的主机上有 cache,可以用 tag。
    pull 下来 /save 然后 load 都不能‘层回滚’的,因为 build 的操作跟上下文环境有关,不像 git。
    https://github.com/moby/moby/issues/20131
    https://github.com/moby/moby/issues/20316
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3386 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 12:23 · PVG 20:23 · LAX 05:23 · JFK 08:23
    ♥ Do have faith in what you're doing.