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

github actions: build OCI images that contain both amd64 and armv7 #1962

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

nodiscc
Copy link
Member

@nodiscc nodiscc commented Mar 21, 2023

@nodiscc nodiscc added enhancement docker containers & cloud labels Mar 21, 2023
@nodiscc nodiscc self-assigned this Mar 21, 2023
@nodiscc nodiscc force-pushed the docker-armv7 branch 2 times, most recently from f0a67b4 to b14245b Compare March 21, 2023 16:32
@nodiscc nodiscc changed the title WIP: Build Docker images that contain both amd64 and /armv7 github actions: build OCI images that contin both amd64 and armv7 Mar 21, 2023
@nodiscc
Copy link
Member Author

nodiscc commented Mar 21, 2023

Rebased, PR description updated. Verified that the resulting image contains both amd64 and arm/v7 builds:

$ docker buildx imagetools inspect ghcr.io/nodiscc/shaarli:latest
Name:      ghcr.io/nodiscc/shaarli:latest
MediaType: application/vnd.docker.distribution.manifest.list.v2+json
Digest:    sha256:c7233e7e11f20c37709150255f66dcb7aa23757a4df7eb258feae9c1c87a42aa
           
Manifests: 
  Name:      ghcr.io/nodiscc/shaarli:latest@sha256:c4c74907f18c35b50d30b22e3219c0b8aaee5cb0e943162fedf9c7133713c7aa
  MediaType: application/vnd.docker.distribution.manifest.v2+json
  Platform:  linux/amd64
             
  Name:      ghcr.io/nodiscc/shaarli:latest@sha256:2f68dde7e685ca41250cafb7a3d084aeea80f057e28710507b18ed61015a5da2
  MediaType: application/vnd.docker.distribution.manifest.v2+json
  Platform:  linux/arm/v7

I made the image name configurable through Github Actions CI variables/secrets, so I will now set DOCKER_IMAGE = shaarli/shaarli in https://github.com/shaarli/Shaarli/settings/secrets/actions.

I will now close #1496 since this PR replaces it. I have no way to test if the resulting image actually works (currently no ARM machine to run it, I will try to create an ARMv7 VM with libvirt/qemu but this might take some time). Maybe @cerebrate or other users with an ARM machine would be able to test ghcr.io/shaarli/shaarli:latest once this PR is merged?

@nodiscc nodiscc removed their assignment Mar 21, 2023
@nodiscc nodiscc added this to the 0.13.0 milestone Mar 21, 2023
@nodiscc nodiscc changed the title github actions: build OCI images that contin both amd64 and armv7 github actions: build OCI images that contain both amd64 and armv7 Mar 21, 2023
@nodiscc nodiscc merged commit a7e361e into shaarli:master Mar 21, 2023
@nodiscc nodiscc deleted the docker-armv7 branch March 21, 2023 17:22
@cerebrate
Copy link

Happy to do that testing.

...incidentally, since it's got a lot more popular since I was first noodling about with arm devices, maybe it's time to add arm64 to the build matrix also?

@ArthurHoaro
Copy link
Member

I made the image name configurable through Github Actions CI variables/secrets, so I will now set DOCKER_IMAGE = shaarli/shaarli in shaarli/Shaarli/settings/secrets/actions.

Wouldn't it make sense to use a variable instead of a secret, since it's not sensitive information?

...incidentally, since it's got a lot more popular since I was first noodling about with arm devices, maybe it's time to add arm64 to the build matrix also?

Agreed, and I happen to have a brand new arm64 chip to test it!

Current behavior:

> docker pull ghcr.io/shaarli/shaarli
Using default tag: latest
latest: Pulling from shaarli/shaarli
no matching manifest for linux/arm64/v8 in the manifest list entries

@cerebrate
Copy link

@nodiscc Looks to be running fine on my 32-bit ARM machine (Raspberry Pi).

@nodiscc
Copy link
Member Author

nodiscc commented Mar 27, 2023

Wouldn't it make sense to use a variable instead of a secret, since it's not sensitive information?

A plain variable would be more appropriate, but I used secrets since we already use them - this way the syntax stays consistent (https://docs.github.com/en/actions/learn-github-actions/variables vs https://docs.github.com/en/actions/security-guides/encrypted-secrets), and everything is immediately visible on Secrets and variables > Actions - I prefer consistency to correctness :) But feel free to change it.

Teresayluis

This comment was marked as spam.

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

Successfully merging this pull request may close these issues.

4 participants