Skip to content

Commit

Permalink
ci: use prebuilt docker image in arm64 build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gemesa committed Dec 20, 2024
1 parent 65b5c49 commit fd9aee1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v1

- name: Build ARM64 image
- name: Pull ARM64 image
run: |
docker build --platform=linux/arm64 -t arm64-env .
docker pull gemesa/arm64:latest
- name: Run ARM64 container
run: |
docker run --platform=linux/arm64 \
--rm \
-v "${{ github.workspace }}":/workspace \
arm64-env \
gemesa/arm64:latest \
make arm64
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,15 @@ $ make x64
I have an x64 PC so to quickly build and run ARM64 binaries my preference is to use an ARM64v8 Docker container. This setup has some limitations though as it does not implement `ptrace` so `strace` and `gdb` cannot be used.

```
$ sudo docker build --platform=linux/arm64 -t arm64-env .
$ sudo docker run --platform=linux/arm64 --user $(id -u):$(id -g) --rm -it -v "$(pwd)":/workspace arm64-env /bin/bash
# make arm64
$ sudo docker build --platform=linux/arm64 -t arm64 .
$ sudo docker run --platform=linux/arm64 --user $(id -u):$(id -g) --rm -it -v "$(pwd)":/workspace arm64 /bin/bash
$ make arm64
```

The image is also available on Docker Hub:

```
$ docker pull gemesa/arm64:latest
```

Alternatively an ARM64 cross-compiler and QEMU could also be used (Docker is doing something similar under the hood).
Expand Down

0 comments on commit fd9aee1

Please sign in to comment.