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

  • 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.

主站蜘蛛池模板: 施秉县| 岳普湖县| 奉化市| 恩施市| 新泰市| 和林格尔县| 赤峰市| 加查县| 石台县| 庆城县| 通城县| 垣曲县| 南昌市| 伊吾县| 遂宁市| 吴堡县| 冷水江市| 满洲里市| 凤翔县| 桦川县| 蓝山县| 札达县| 香格里拉县| 盱眙县| 大冶市| 玛曲县| 玉龙| 南和县| 阿拉善盟| 遵化市| 邛崃市| 沽源县| 崇礼县| 定日县| 建水县| 郴州市| 新巴尔虎右旗| 潢川县| 屏南县| 榆社县| 巫溪县|