官术网_书友最值得收藏!

  • Deployment with Docker
  • Srdjan Grubor
  • 200字
  • 2021-07-02 23:22:13

Labels

Our first new directive here is LABEL:

LABEL version="1.0"
LABEL org.sgnn7.name="python-webserver"

LABEL <key>=<value> or LABEL <key> <value> is used to add metadata about the image that is being built, which can later be examined and filtered by docker ps and docker images using something like docker images --filter "<key>=<value>". Keys are generally all lowercase in the reverse-dns notation, but you can use anything you want here and version should be present on every image, so we use the top-level version key name. However, the version here is not only there so that we can filter images but also to break Docker's cache if we change it. Without cache-busting of this sort or through the manually set flag during builds ( docker build --no-cache ), Docker will keep reusing the cache all the way up to the most recently changed directive or files so there is a high probability that your container will stay stuck in a frozen package configuration. This condition may or may not be what you want, but just in case you have automated build tooling, adding a version layer that can break the cache whenever you change it makes the container very easy to update.

主站蜘蛛池模板: 连江县| 南部县| 沐川县| 莱阳市| 成安县| 富锦市| 伽师县| 九江市| 大竹县| 镇沅| 枣庄市| 荥经县| 融水| 杭锦旗| 密山市| 金门县| 临武县| 大厂| 营口市| 双峰县| 东平县| 保亭| 新宾| 阿鲁科尔沁旗| 元谋县| 静宁县| 图木舒克市| 凤阳县| 扬州市| 承德市| 永善县| 衡南县| 济阳县| 东港市| 福贡县| 铜陵市| 辽源市| 沙湾县| 栾川县| 渝中区| 镇平县|