Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (29.3k points)

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

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

server              latest              d583c3ac45fd        26 minutes ago      685.5 MB

Hence I want to change the name server to something like myname/server:

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

myname/server       latest              d583c3ac45fd        26 minutes ago      685.5 MB

How can I do this?

1 Answer

0 votes
by (50.2k points)

For this you could use: 

docker tag server:latest myname/server:latest

or

docker tag d583c3ac45fd myname/server:latest

Tags are the aliases for the full image name (d583c3ac45fd...).

So you can have as many of them associated with the same image as you like. You can remove the old name after you've re-tagged it:

docker rmi server

That will just remove the alias/tag. Since d583c3ac45fd has other names, the actual image won't be deleted.

Related questions

0 votes
1 answer
0 votes
1 answer

Browse Categories

...