felixfbecker / semantic-release-docker

🐳 Set of semantic-release plugins to publish to DockerHub
MIT License
76 stars 14 forks source link

Versioned image tag not pushed, only 'latest' #40

Open pmlk opened 3 years ago

pmlk commented 3 years ago

We're using semantic-release-docker in GitLab CI to push docker images to the repo's integrated GitLab container registry. It works great most of the time 👍 😃 Sometimes, however, only the latest tag of an image is pushed but not the explicit version tag.

From the logs (see below) it seems that it's trying to push a tagged image before the image is actually tagged, if that makes sense:

# image:1.10.0-alpha.4 doesn't yet exist
docker push image:1.10.0-alpha.4
docker tag image:latest image:1.10.0-alpha.4

Logs

Failure Case ``` [12:29:43 PM] [semantic-release] › ✔ Published release 1.10.0-alpha.4 on channel The push refers to repository [registry.gitlab.com/] The push refers to repository [registry.gitlab.com/] babbcba5fb0a: Preparing cbf996eab0db: Preparing bffa2b44b20d: Preparing 58cec4576975: Preparing 66cf6e550d25: Preparing 234e49dc9d64: Preparing 87f6a206d8c2: Preparing efe9f72a5423: Preparing ffa572135c58: Preparing 9a5d14f9f550: Preparing 234e49dc9d64: Waiting 87f6a206d8c2: Waiting efe9f72a5423: Waiting ffa572135c58: Waiting 9a5d14f9f550: Waiting tag does not exist: registry.gitlab.com/:1.10.0-alpha.4 66cf6e550d25: Pushed 58cec4576975: Pushed babbcba5fb0a: Pushed cbf996eab0db: Pushed 87f6a206d8c2: Layer already exists efe9f72a5423: Layer already exists ffa572135c58: Layer already exists 9a5d14f9f550: Layer already exists 234e49dc9d64: Pushed bffa2b44b20d: Pushed latest: digest: sha256:a77cef2252efbea602ce774d02abbf54d5bfaf2c12c9437091097f327d946229 size: 2412 ```
Success Case ``` [12:41:58 PM] [semantic-release] › ✔ Published release 1.10.0-alpha.4 on channel The push refers to repository [registry.gitlab.com/] 05de4552efa0: Preparing d75ef1c72465: Preparing 9f3033790d95: Preparing b796499b3277: Preparing 227f88932d8f: Preparing 1c607b60d334: Preparing 87f6a206d8c2: Preparing efe9f72a5423: Preparing ffa572135c58: Preparing 9a5d14f9f550: Preparing 1c607b60d334: Waiting 87f6a206d8c2: Waiting efe9f72a5423: Waiting ffa572135c58: Waiting 9a5d14f9f550: Waiting The push refers to repository [registry.gitlab.com/] 05de4552efa0: Preparing d75ef1c72465: Preparing 9f3033790d95: Preparing b796499b3277: Preparing 227f88932d8f: Preparing 1c607b60d334: Preparing 87f6a206d8c2: Preparing efe9f72a5423: Preparing ffa572135c58: Preparing 9a5d14f9f550: Preparing 9a5d14f9f550: Waiting 1c607b60d334: Waiting 87f6a206d8c2: Waiting efe9f72a5423: Waiting ffa572135c58: Waiting b796499b3277: Pushed b796499b3277: Pushed 05de4552efa0: Pushed 05de4552efa0: Pushed 227f88932d8f: Pushed 227f88932d8f: Pushed 87f6a206d8c2: Layer already exists 87f6a206d8c2: Layer already exists efe9f72a5423: Layer already exists efe9f72a5423: Layer already exists d75ef1c72465: Pushed d75ef1c72465: Pushed 9a5d14f9f550: Layer already exists 9a5d14f9f550: Layer already exists ffa572135c58: Layer already exists ffa572135c58: Layer already exists 1c607b60d334: Pushed 1c607b60d334: Pushed 9f3033790d95: Pushed 9f3033790d95: Pushed latest: digest: sha256:656adf9678eca876c4d14a7f7a2c8f0090c9321f9798a47108e09faae384067b size: 2412 1.10.0-alpha.4: digest: sha256:656adf9678eca876c4d14a7f7a2c8f0090c9321f9798a47108e09faae384067b size: 2412 ```

How to reproduce

🤷‍♂️

I don't see any pattern when this does or does not happen. Seems random.

Current workaround