Docker for Mac - Kubernetes - reference local image

后端 未结 3 900
迷失自我
迷失自我 2020-12-29 19:25

I am using Docker for Mac with Kubernetes support and I\'m struggling to create a Kubernetes Deployment that references a locally built image.

Output of docker

3条回答
  •  臣服心动
    2020-12-29 20:10

    In addition to techtrainer comment and answer, I would like to provide some examples of how to do it.

    General rule. You have to use tag version of images rather than latest. With Docker tags, the more specific you can get, the better. Get specific to avoid using the wrong image. Consider this if you don't want your colleagues or other Docker users pulling down images and having no idea how recent they are. Get specific to avoid such issues.

    docker tag IMAGE ID image/TAG:version.d.m.y
    

    For better management of your images, you should have some smart convention of naming. I prefer to use a stage, version, and date of creation of the image. For example:

    docker tag 113a43faa138 ubuntu/prod:v1.8.6.2018
    

    It means production stage, version 1, created on 8 June 2018.

    And that's all. Your version is available, and naming is easier to understand for you and further users of this image.

提交回复
热议问题