anope / docker

Anope Docker image
https://hub.docker.com/r/anope/anope
15 stars 13 forks source link

Added ARM64 image build and switched to Docker BuildX for multi-platf… #13

Closed kaitlinsm closed 3 years ago

kaitlinsm commented 3 years ago

…orm support

Dropped the use of sheogorath/readme-to-dockerhub in favour of more publically used GitHub action. Moved the tests to the top of the pipeline as they don't depend on the image being built, so the pipeline fails fast.

On forks and branches, it will only build the AMD64 container and won't push to Docker Hub. When running on anope/anope:master, it will build all architectures, push to Docker Hub, and update the Readme and repo description.

This PR will require the secrets DOCKER_USERNAME and DOCKER_PASSWORD to exist and refer to a non-2FA enabled account on Docker Hub (should be already set up as those secrets were used previously).

The BuildX builds both arm64 and amd64 container images, and the build pipeline time increases dramatically (from ~6m to ~30m) due to the extra effort of cross-compiling for ARM.

Other architectures can be built by extending the list of architectures set in the Pipeline Variables step - the line echo "::set-output name=platforms::linux/amd64,linux/arm64" can be extended and BuildX should just magically make it happen.

I can't be 100% sure that this will work once merged because the actual configuration will only run when it's merged to anope/anope:master, which I can't do - but I have tested it in my own fork against my personal Docker Hub account and it worked fine.