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

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.

主站蜘蛛池模板: 文安县| 南投市| 上思县| 多伦县| 建阳市| 九寨沟县| 泰州市| 邢台市| 容城县| 古田县| 禄丰县| 仁化县| 通州市| 碌曲县| 冷水江市| 昭觉县| 神池县| 临夏市| 罗田县| 吉林省| 扶风县| 乌兰察布市| 社会| 黄山市| 蓬莱市| 南和县| 浙江省| 平武县| 富宁县| 正安县| 沂水县| 绥宁县| 云梦县| 丰镇市| 手机| 山阴县| 舞钢市| 石棉县| 龙陵县| 小金县| 新丰县|