Can I build containers based on hub.docker.com images?
Can I build docker images that use images hosted on hub.docker.com? My google-fu is failing me or at least not giving me the right answers if there are any... My guess is no but no harm in asking... :) Cheers in advance....
Hi Martin, yes, it is possible to do things like that if you host your own OBS and use the distribution on demand feature for Images. I have some doubts if this really is useful, since the typical Dockerfile has to be rewritten anyways, and it actually means, that you have no full control over your container image anymore. I would only do things like that if you have a supported base image that has a guaranteed supply chain. You will also have to have all the needed packages matching that base image available to you. I for one either take one of the base images available on OBS, or I just create my own with kiwi (actually doing both). Berthold On Tue, 16 Jul 2024 07:56:28 +0100 Martin Hooper <martin@mjhooper.co.uk> wrote:
Can I build docker images that use images hosted on hub.docker.com?
My google-fu is failing me or at least not giving me the right answers if there are any... My guess is no but no harm in asking... :)
Cheers in advance....
Martin Hooper <martin@mjhooper.co.uk> writes:
Can I build docker images that use images hosted on hub.docker.com?
Maybe. The buildservice supports to build against registries that have been setup as projects. At the moment I am aware of: - registry.suse.com as SUSE:Registry - registry.opensuse.org as openSUSE:Registry (albeit this one is kinda pointless, as registry.opensuse.org is OBS itself) and the one you're looking for as Docker:Registry [1]. They way you'd use it, is to add the following path entry to the meta of your container building repository: --8<---------------cut here---------------start------------->8--- <path project="Docker:Registry" repository="standard"> --8<---------------cut here---------------end--------------->8--- You have to change the FROM line of your Dockerfile. Instead of the full registry path, you only include the "build tag", which is everything after the registry url. E.g. `docker.io/library/debian` would become `library/debian`. I have not tested that docker hub actually works though and you might run into rate limiting issues. So your mileage may wary. Cheers, Dan Footnotes: [1] https://build.opensuse.org/project/show/Docker:Registry -- Dan Čermák <dcermak@suse.com> Software Engineer Development tools SUSE Software Solutions Germany GmbH Frankenstr. 146 90461 Nürnberg Germany www.suse.com Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich (HRB 36809, AG Nürnberg)
participants (3)
-
Berthold Gunreben
-
Dan Čermák
-
Martin Hooper