The push
will be accepted by the registry and the new image will be available under the tag (unless both the old image and the new are the same).
But it will not be simply overwritten. While doing the push, docker
compares the layers one by one until there is a difference. The layers already existing will not be uploaded but they will be reused from the former image.
Example trace, when I repushed the same image:
The push refers to repository [registry.example.com/path/img-name]
fb2fa896af31: Preparing
b16ac8c37c08: Preparing
ab696326a8e4: Preparing
a30f02440bbb: Preparing
b3ad88565092: Preparing
0fcbbeeeb0d7: Preparing
0fcbbeeeb0d7: Waiting
b16ac8c37c08: Layer already exists
a30f02440bbb: Layer already exists
ab696326a8e4: Layer already exists
fb2fa896af31: Layer already exists
b3ad88565092: Layer already exists
0fcbbeeeb0d7: Layer already exists
tag-name: digest: sha256:00594915da86f6d1331a53d525af0a30c87ec73b19429a4ced32ea92b0741a15 size: 666
The images are generally stored (and uploaded or downloaded) by individual layers. This also explains, that deleting an image of some tag actually doesn't delete any image, just untags the pointer (unless some sort of GC is forced).