Skip to content

Commit 6e08086

Browse files
docs: add a README QEMU usage example
1 parent 6632d37 commit 6e08086

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,34 @@ jobs:
3535
uses: docker/setup-qemu-action@v4
3636
```
3737
38+
This action registers QEMU emulators with `binfmt_misc`, so later steps can run
39+
containers built for another architecture on the GitHub-hosted runner.
40+
41+
```yaml
42+
name: run-cross-platform-container
43+
44+
on:
45+
workflow_dispatch:
46+
47+
jobs:
48+
qemu-example:
49+
runs-on: ubuntu-latest
50+
steps:
51+
-
52+
name: Set up QEMU
53+
uses: docker/setup-qemu-action@v4
54+
-
55+
name: Run an arm64 container
56+
run: docker run --rm --platform linux/arm64 alpine uname -m
57+
```
58+
59+
The command above prints `aarch64` even though the job itself is running on
60+
`ubuntu-latest`.
61+
62+
> [!TIP]
63+
> `setup-qemu-action` enables user-mode emulation for registered platforms. It
64+
> does not install `qemu-system-*` tools or add `qemu-*` binaries to your PATH.
65+
3866
> [!NOTE]
3967
> If you are using [`docker/setup-buildx-action`](https://github.com/docker/setup-buildx-action),
4068
> this action should come before it:

0 commit comments

Comments
 (0)