From #wikimedia-gitlab a few days ago:
15:31:59 <dcaro> Have we enabled/found out how to build images on gitlab-ci? I ask because I want to test https://gitlab.wikimedia.org/repos/cloud/toolforge/alerts/-/merge_requests/2 the same as the ops/alerts gerrit one, but that one uses blubber to build the image on the fly 15:32:41 I'm interested also if it's possible to just build and push images (to our own harbor repository for toolforge) 15:36:11 <jelto> dcaro: you can use kokurri for building images with blubber files https://gitlab.wikimedia.org/repos/releng/kokkuri/-/blob/main/README.md#examples. RelEng build some abstraction for that use case 15:37:04 <dcaro> that's pretty cool 15:39:12 that solves one of the issues :) 15:39:12 For the other, can I build not blubber-based images too? (and push them to other repos like tools-harbor.wmcloud.org?) 15:40:32 <taavi> I don't see any issues with converting our Dockerfiles to blubber :P but yes, the other registry question is more important 15:41:17 <dcaro> that'd be interesting too yes 15:41:21 (the conversion I mean) 17:45:32 <dcaro> there's still the question on how to push to other repos (and maybe use docker instead of blubber, though that's not a big issue) 17:51:10 <dancy> Try something like this: 17:51:14 https://www.irccloud.com/pastebin/PllJI3mH/ 17:54:38 You can also add PUBLISH_IMAGE_NAME to set the image path within the registry (defaults to the GitLab repo path) 17:55:33 <dcaro> How do I pass the credentials? 17:55:37 (awesome btw.) 17:56:29 <dancy> hmm.. good question.. we automatically set up JWT auth but you'll presumably need something else for the other registry.. Lemme dig. 17:57:57 Looks like we'll need to do some coding to support alternate auth mechanisms. 18:12:10 Alternative: Use the kokuri image, but run the following in the script section: 18:12:13 https://www.irccloud.com/pastebin/3nGzEEtI/ 18:12:22 (untested) 18:12:40 Before that, add stuff to populate ~/.docker/config.json with auth info 18:15:08 <taavi> can/should we do that on the shared runners or should we set up our own runners for that? 18:15:17 <dancy> That will work on shared runners. 18:16:19 btw, when running buildctl manually, you can supply any frontend (e.g, the dockerfile frontend), so you're not locked to using blubber files. 18:17:52 To do that, use `--frontend=dockerfile.v0` (and exclude --opt source=...) 18:21:56 and point `--opt filename=` to the Dockerfile