I'm trying to change repository name of the image:
Using docker command tag:
which means you can:
Or using image id:
Tags are just human-readable aliases for the full image name (d583c3ac45fd...). So you can have as many of them associated with the same image as you like. If you don't like the old name you can remove it after you've retagged it by docker command rmi:
That will just remove the alias/tag. Since d583c3ac45fd has other names, the actual image won't be deleted.