Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated multi-platform build and DockerHub publication #8

Merged
merged 2 commits into from
Feb 6, 2022

Conversation

schklom
Copy link
Contributor

@schklom schklom commented Feb 6, 2022

This setup uses GitHub Actions to build an image for arm/v7 and arm64 then publish them on DockerHub (you need to setup repo secrets first) every time you want (workflow_dispatch), every push, every pull requests (pull_requests), or on a schedule (cronjob).
It also checks the dependencies' versions for the Actions everyday and creates a pull request if there are new versions available.

Remove the triggers you don't want :)

Reminder: if you ever move the Dockerfile (or some dependencies), you will have to correct the Dockerfile path (and/or the context path).

This setup uses GitHub Actions to build an image for arm/v7 and arm64 then publish them on DockerHub (you need to setup repo secrets first) every time you want (workflow_dispatch), every push, every pull requests (pull_requests), or on a schedule (cronjob) :)

Remove the triggers you don't want.

Reminder: if you ever move the Dockerfile (or some dependencies), you will have to correct the Dockerfile path (and/or the context path).
This checks the dependencies' versions for the Actions everyday and creates a pull request if there are new versions available.
@alextran1502
Copy link
Contributor

If I understand this correctly, whenever there is a new push or PR merged to the main branch, Github action would package the server image and push it to the specified location on the docker hub, correct? Then in docker-compose, we can use that image instead of building from local if we want to.

@schklom
Copy link
Contributor Author

schklom commented Feb 6, 2022

Exactly! I set it up only for armv7 and arm64, but you can test other platforms (list at https://github.com/docker/setup-qemu-action).

Instead of doing it on every push or pull, you can also trigger it manually in the Actions tab, or have it done on a cron schedule.

You can also pick the repo you want to publish to. I set it up for DockerHub, but you can use all the common ones like Google/GitHub/Amazon/etc

More customization options are there: https://github.com/marketplace/actions/build-and-push-docker-images

You can also run tests on the image https://github.com/docker/build-push-action/blob/master/docs/advanced/test-before-push.md

@schklom schklom changed the title Automated multi-arch build and DockerHub publication Automated multi-platform build and DockerHub publication Feb 6, 2022
@alextran1502
Copy link
Contributor

Thank you, merged!

@alextran1502 alextran1502 merged commit c917875 into immich-app:main Feb 6, 2022
@schklom
Copy link
Contributor Author

schklom commented Feb 7, 2022

@alextran1502 I see the action failed because you didn't setup the login correctly. If you want to publish on DockerHub, you need to

The process is similar if you prefer other platforms than DockerHub, although you would need to use a different GitHub Action instead of docker/login-action@v1.

Copy link

cloudflare-workers-and-pages bot commented Feb 6, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8eb9dad
Status:⚡️  Build in progress...

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants