buildkite-plugins / docker-compose-buildkite-plugin

🐳⚡️ Run build scripts, and build + push images, w/ Docker Compose
MIT License
172 stars 139 forks source link

cache-from and push fail when specifying docker repository port #363

Closed ajoneil closed 1 year ago

ajoneil commented 1 year ago

We're using an internal docker registry for our CI, available at hostname registry on the default port 5000.

Specifying the image-repository as registry/myimage causes docker to assume it's referring to docker.io/registry/mycoolimage as the hostname does not contain any ., which is not at all desired. Instead using registry:5000/myimage corrects this issue, but the additional : breaks the tag parsing here: https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/blob/master/commands/build.sh#L57 and here: https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/blob/master/commands/push.sh#L25

Giving the errors: 🚨 cache-from registry:5000/myimage has an invalid tag so it will be ignored and 🚨 specified image to push test-runner:registry:5000/myimage:latest has an invalid tag so it will be ignored

toote commented 1 year ago

@ajoneil that is indeed a very troublesome issue... and it is completely self-inflicted because of using the colon to separate fields ignoring the fact that a registry could indeed have a port :facepalm:

I think I have a way to solve your issue without forcing everyone to update their cache-from configurations :thinking: Stay tuned!