To rename an image, you give it a new tag, and then remove the old tag using the ‘rmi’ command:

  • $ docker tag <old_name> <new_name>
  • $ docker rmi <old_name>

This second step is scary, as ‘rmi’ means “remove image”. However, docker won’t actually remove the image if it has any other tags. That is, if you were to immediately follow this with: docker rmi <new_name>, then it would actually remove the image (assuming there are no other tags assigned to the image).

 

Ref:

https://www.quora.com/How-does-one-rename-a-docker-image

相关文章:

  • 2021-07-12
  • 2021-10-04
  • 2021-11-27
  • 2021-08-01
  • 2022-12-23
  • 2021-11-09
  • 2021-09-01
猜你喜欢
  • 2021-09-29
  • 2021-09-06
  • 2022-12-23
  • 2021-06-06
  • 2021-10-15
  • 2022-12-23
  • 2022-02-07
相关资源
相似解决方案