Skip to content

Commit

Permalink
packages almalinux: add --platform linux/arm64 when building arm64'…
Browse files Browse the repository at this point in the history
…s image (groonga#1807)

ref: groonga#1806

This change solves the following error on CI.
Because Docker build process does not automatically detect the correct
platform for the image. As a result, the platform information defaults
to the host platform. So in this case, platform infromation wasn't as a
arm64.

To resolve this issue, we need to specify the platform explicitly in the
Docker build command.
ref: https://docs.docker.com/build/building/multi-platform/

Here is the error log:


https://github.com/groonga/groonga/actions/runs/9705591558/job/26788067581#step:9:42

```
------
#3 [internal] load metadata for docker.io/arm64v8/almalinux:8
#3 ERROR: no match for platform in manifest: not found
------
Dockerfile:2
--------------------
   1 |     ARG FROM=almalinux:8
   2 | >>> FROM ${FROM}
   3 |
   4 |     ARG DEBUG
--------------------
ERROR: failed to solve: arm64v8/almalinux:8: failed to resolve source metadata for docker.io/arm64v8/almalinux:8: no match for platform in manifest: not found
rake aborted!#1 [internal] load build definition from Dockerfile
```

---------

Co-authored-by: Horimoto Yasuhiro <horimoto@clear-code.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
3 people authored Jul 1, 2024
1 parent 69ac9d2 commit fa62389
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -327,7 +327,16 @@ jobs:
# Test
- name: Test
run: |
case "${{ matrix.test-docker-image }}" in
arm64v8/*)
platform=linux/arm64
;;
*)
platform=linux/amd64
;;
esac
docker run \
--platform ${platform} \
--rm \
--volume ${PWD}:/groonga:ro \
${{ matrix.test-docker-image }} \
2 changes: 1 addition & 1 deletion packages/yum/almalinux-8-aarch64/from
Original file line number Diff line number Diff line change
@@ -1 +1 @@
arm64v8/almalinux:8
--platform=linux/arm64 arm64v8/almalinux:8
2 changes: 1 addition & 1 deletion packages/yum/almalinux-9-aarch64/from
Original file line number Diff line number Diff line change
@@ -1 +1 @@
arm64v8/almalinux:9
--platform=linux/arm64 arm64v8/almalinux:9

0 comments on commit fa62389

Please sign in to comment.