How to create named and latest tag in Docker?

后端 未结 6 778
北海茫月
北海茫月 2020-12-04 05:17

Supposed I have an image that I want to tag as 0.10.24 (in my case it\'s an image containing Node.js 0.10.24). I built that image using a Dockerfile and executi

6条回答
  •  旧时难觅i
    2020-12-04 05:24

    Once you have your image, you can use

    $ docker tag  /:
    
    1. Build and tag the image with creack/node:latest

      $ ID=$(docker build -q -t creack/node .)
      
    2. Add a new tag

      $ docker tag $ID creack/node:0.10.24
      
    3. You can use this and skip the -t part from build

      $ docker tag $ID creack/node:latest
      

提交回复
热议问题