Docker Community Forums

Share and learn in the Docker community.

How to manually build repos on Docker Hub

I was trying to add a new Docker repo to my organization and it looks like automated builds for Docker Hub are no longer supported?

When I click on the Builds tab for an existing repository I see “Available with Pro, Team and Business subscriptions” and a blue “Upgrade to Team” button.

If automated builds aren’t supported I’d be happy to manually build repos on Docker Hub but idk how to do that either.

One thing I am not going to do is pay for this. I’m maintaining these builds as part of a not-for-profit open source project:

The existing Docker repos don’t get a ton of downloads:

https://hub.docker.com/orgs/phpseclib

BUT, as I’ve already stated, this isn’t being done as anything for-profit or anything.

Any ideas?

Are you familiar with docker docker build command?

If you can create your own build process, you can use Travis CI for automated builds independently from Docker Hub. There are other alternatives too, but this is what I use for free.

Consider a ten year old Dockerfile.

If you try to build it locally today and the Dockerfile was doing wget’s it’s quite possible the URLs that the wget is attempting to fetch aren’t even valid anymore and, even if they were, the local certs would likely be all expired, which would complicate how you’d need to get stuff from https URLs.

Also, if you use Travis CI to build Dockerfile’s vs relying on pre built images hosted on Docker Hub or whatever then unit tests designed to run after every commit (the “continuous” part of continuous integration [CI]) then the unit tests will take a ton more time.

If local builds were the bees knees then Docker Hub wouldn’t be nearly as valuable a service as it currently is.

How would Docker Hub solve it?

I use Travis CI to build my own images based on pre-built images. I test what I want to test. Nothing more.

If Docker Hub did the build ten years ago then Docker Hub would presumably still have the build. ie. you’d be using a ten year old build instead of a brand new build, which wouldn’t succeed, anyway, due to broken URLs.

I mean, most images are built off of pre-built images, I would imagine. If you’re building an image off of php:8.1 then that image is, itself, built off of debian:bullseye-slim:

But if you’re doing ./config, make, make install a bunch of times, that all takes time and I’d rather the unit tests that continuous integration runs complete as fast as possible instead of taking 30m because the Docker image is being rebuilt over and over and over again.

I mean, no rebuilding is needed if you’re using an image already on Docker Hub, but if you’re not - if you’re installing additional extensions and what not - then you’re gonna have to build those additional layers each and every time. I mean, docker does seem to cache layers when I build stuff locally but how does caching work on Travis CI? https://github.com/travis-ci/travis-ci/issues/5358#issuecomment-248915326 discusses this some but overall it seems waaaaay less ideal than just having the image on Docker Hub. Like what if a particular image isn’t used in CI very often? The cache is most likely not going to store that image into perpetuity. And what if you wanted to run it locally? Even if Travis CI did have the image cache’d that is of little benefit to local uses.

And in any event, this is all not even remotely related to what I’m asking.

Is it possible to make it manually create a build on Docker Hub. Creating a build manually is easy enough. Creating one on Travis CI is easy enough. BUT there are advantages to having the build be on Docker Hub. Builds can be automatically created on Docker Hub by commits to a git repo but can builds on Docker Hub be manually created? That is what I am wanting to know.

Also, frankly, consistency is nice. I don’t want to have to do docker pull "phpseclib/php8.0" for PHP 4.4 through 8.0 an then docker build for PHP 8.1+. I would rather have uniform instructions. But in any event, I am not interested in discussing the merits of Docker Hub vs the alternatives. I mean, if I have to justify my request to get an answer to my question, I’ll do so, but even if I manage to convince you, I’m not convinced that an answer to my question will be forthcoming…

You don’t have to justify anything. I simply don’t know any way to trigger a build without having a subscription but I wanted to help you anyway. I have that button in the repositories of my personal namespace with Pro subscription but I don’t have it in my organization, only the “Upgrade to Team” button. You could try to find a webhook but I suspect that would not work. If you find any, please share it.

PS.: recommending the docker build command was a misunderstanding. Sorry about that.

1 Like