pobing123
V2EX  ›  Docker

docker 从仓库更新 images 到本地,怎么才最优雅?

  •  
  •   pobing123 · Dec 23, 2020 · 2944 views
    This topic created in 2147 days ago, the information mentioned may be changed or developed.
    刚入门 docker,还是小白。
    比如从 hub.docker 更新 redis 的 latest 版本。
    docker pull redis
    更新完后,本地较早的版本的名字会变成<none>
    需要手动 docker rmi 删除
    这也太麻烦事了。
    有更好的办法吗?
    提前感谢
    8 replies  •  2020-12-25 11:25:52 +08:00
    boris93
    boris93
    Dec 23, 2020 via Android
    1
    隔一段时间 grep 出来 none 标签的批量删除
    julyclyde
    julyclyde
    Dec 23, 2020
    2
    cron 执行 docker prune
    hteen
    hteen
    Dec 23, 2020
    3
    watchtower
    stille
    stille
    Dec 23, 2020 via iPhone
    4
    watchtower 单次更新可以自动拉取新的,删除旧的并按照之前启动参数重启容器

    参考

    https://www.ioiox.com/archives/84.html
    monkeyWie
    monkeyWie
    Dec 23, 2020 via Android
    5
    docker pure 定期执行
    Tink
    Tink
    Dec 24, 2020 via Android
    6
    定期 prune
    pobing123
    pobing123
    OP
    Dec 24, 2020
    7
    感谢以上各位。
    原以为,docker 存在单条命令,可以原有镜像上附加更新层
    julyclyde
    julyclyde
    Dec 25, 2020
    8
    @pobing123 可以附加。问题是这镜像的构建过程,新旧版本是分叉的,而不是叠加的关系
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4160 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 08:55 · PVG 16:55 · LAX 00:55 · JFK 03:55
    ♥ Do have faith in what you're doing.