简体   繁体   English

Docker开发版/快照

[英]Docker development version/snapshot

I'm trying to achieve the same mechanism as maven provides for SNAPSHOT versions. 我正在尝试实现与maven为SNAPSHOT版本提供的相同机制。 Basically, whenever I have a development on a Dockerfile, I want to be able to create temporary versions in my private registry. 基本上,每当我在Dockerfile上进行开发时,我希望能够在我的私有注册表中创建临时版本。

I could create a tag and force push on this tag, but I'd rather keep one version in the registry for a given tag. 我可以创建一个标签并强制推送此标签,但我宁愿在注册表中为给定标签保留一个版本。

If Docker image A depends FROM B (on 1.2.SNAPSHOT for instance), then the latest 1.2.x tag will get pulled. 如果Docker镜像A依赖于FROM B(例如1.2.SNAPSHOT),那么最新的1.2.x标签将被拉出。

Is there a special keyword in image version that performs what I'm actually trying to achieve ? 图像版本中是否有一个特殊的关键字来执行我实际想要实现的目标?

Hope this is clear enough :) 希望这很清楚:)

I hadn't used them, but it sounds like Maven snapshots are used to indicate a development version. 我没有使用它们,但听起来像Maven快照用于表示开发版本。 As a result new versions are always checked for and fetched. 因此,始终检查并获取新版本。

To get similar behavior in docker, I believe you'd need to check for a newer base image on each build. 为了在docker中获得类似的行为,我相信您需要在每个构建中检查更新的基本映像。 That's an option in docker build: --pull 这是--pull build中的一个选项:-- --pull

docker build --pull -t myimage .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM