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

build images for amd64 and arm64 platform (for Apple Silicon, M1, M2) #33

Conversation

albertborsos
Copy link
Contributor

@albertborsos albertborsos commented Apr 10, 2023

Q A
Is bugfix?
New feature? ✔️
Breaks BC?
Fixed issues it builds images for amd64 and arm64

I saw it late, there is another PR (#31 ) which resolves this issue. Mine is different, because I used the native docker actions, not directly the buildx command.

The tests runs only for amd64, that is why it is fast. The master builds lasts for 1 hour both for amd64 and arm64.

Since I made it for the other repository (yiisoft/yii2-docker#161), I updated this, with the same modifications.

Images are pushed to here: https://hub.docker.com/repository/docker/albertborsos/yii-php/general

I tested, it works.

@albertborsos albertborsos force-pushed the feature/build-images-for-multiple-platforms branch from 8bcfa3b to 80db364 Compare April 10, 2023 12:42
@albertborsos albertborsos changed the title build images for amd64 and arm64 with qemu and buildx build images for amd64 and arm64 platform (for Apple Silicon, M1, M2) Apr 10, 2023
@schmunk42
Copy link
Contributor

The tests runs only for amd64, that is why it is fast. The master builds lasts for 1 hour both for amd64 and arm64.

Please see #31 (comment)

Ideally it would build arm64 weekly and if we need it manually.

How does this PR only build on master?

files: docker-compose.yml
load: true
set: |
*.platform=linux/amd64
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is why tests runs only for amd64, that is why it is quick for pull requests and push events.

files: docker-compose.yml
push: true
set: |
*.platform=linux/amd64,linux/arm64
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there is an if statement, it runs only for tags and for the master branch.

@albertborsos
Copy link
Contributor Author

It already runs for amd64 and arm64 weekly. I do not see any advantages if it would be separated. I spent 2 days to implement this. I do not have more free time to work on this. I can develop now with my own builds, and I have to.

But you can modify this PR as you like.

@schmunk42 schmunk42 merged commit 43f7bf6 into yiisoft:master Apr 11, 2023
12 checks passed
@schmunk42
Copy link
Contributor

I've added an additional step to build arm only on master/tags AND schedule/manually.

Thank you!

@albertborsos albertborsos deleted the feature/build-images-for-multiple-platforms branch May 17, 2023 21:09
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.

None yet

2 participants