j8r / dockerfiles

Repository for my dockerfiles
https://hub.docker.com/u/jrei
ISC License
121 stars 46 forks source link

Githubactions docker buildx #21

Closed rnsc closed 3 years ago

rnsc commented 3 years ago

This PR aims at fixing the following issue: https://github.com/j8r/dockerfiles/issues/20 It's a bit more complex than the simple trigger of the builds on Docker Hub, but it adds multi arch images.

The only thing needed for this to work is the provisioning of two secrets: DOCKER_HUB_USERNAME DOCKER_HUB_TOKEN

@j8r I hope you'll like this approach.

j8r commented 3 years ago

Great work, thanks @rnsc. Can this 3 jobs be in a single file, to avoid repetition (merged matrix)?

This is also a welcome change because autobuilds will be now disabled. I'll be able to remove the Docker Hub integration altogether.

rnsc commented 3 years ago

Sure, I did split them for clarity and ease of use (only triggering build when the files for a specific OS were changed).

I'm not against merging everything into one matrix. I'll update the PR.

rnsc commented 3 years ago

I'll also switch the tags from my personal repo to jre

rnsc commented 3 years ago

@j8r all done :)

rnsc commented 3 years ago

Btw Debian 8 doesn't have arm images, so it only builds an amd64 image. Centos8 doesn't have an arm/v7 image, so it's also removed. And there's no arm/v8 because the buildx doesn't support it.

j8r commented 3 years ago

That's because arm64 is at least armv8. They could have also called armv7 armhf.

j8r commented 3 years ago

only triggering build when the files for a specific OS were changed

It is possible? Generally all the CIs will run whatever the change in the repo is.

rnsc commented 3 years ago

only triggering build when the files for a specific OS were changed

It is possible? Generally all the CIs will run whatever the change in the repo is.

Yes, if you look at the top here

https://github.com/j8r/dockerfiles/commit/63bf17e310450a752a561d94c534126bb031f49d

There's a path defined, so it would only trigger if of the files in that was updated. That's when having multiple build file is either to maintain imho. Let me know what you think and I can rollback to the split version.

j8r commented 3 years ago

I guess it's fine with the merged version, the repository has very few changes. Plus, this does not prevent to rebuild other versions of a given distribution - not really worth it. Plus, this Dockerfiles are very simple and quick to build.

j8r commented 3 years ago

Thanks a lot @rnsc!