You can retag a Docker image referenced by name and tag as follows:

docker tag old-tag new-tag

Example:

docker tag webserver:old kindacode/webserver:new

You can also tag/retag an image with its ID:

docker tag <image-ID> <my-image-name:tag>

Further reading

You can also check out our Docker topic page for the latest tutorials, examples, tips, and tricks.