Docker how to change repository name or rename image?

后端 未结 8 1645
庸人自扰
庸人自扰 2020-12-22 15:42

I\'m trying to change repository name of the image:

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
server               


        
相关标签:
8条回答
  • 2020-12-22 16:15

    As a shorthand you can run:

    docker tag d58 myname/server:latest
    

    Where d58 represents the first 3 characters of the IMAGE ID,in this case, that's all you need.

    Finally, you can remove the old image as follows:

    docker rmi server
    
    0 讨论(0)
  • 2020-12-22 16:18

    docker run -it --name NEW_NAME Existing_name

    To change the existing image name.

    0 讨论(0)
提交回复
热议问题