From e094f5825cc08b59cc91b22ea6527d3e9fb3840c Mon Sep 17 00:00:00 2001 From: Solomon Jacobs Date: Sun, 15 Dec 2024 10:42:19 +0100 Subject: [PATCH] Provide usage examples in README.md We provide two simple examples of invoking `qemu-{arch}-static` (or more precisely, we let the kernel do the invocation.) Closes: #95 Signed-off-by: Solomon Jacobs --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index e94aeeb..05c42da 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,26 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v4 + with: + platforms: arm64, i386 + - + name: Create an example binary for AArch64 + run: | + go mod init hello + cat << EOL > hello.go + package main + + func main() { + println("Hello, AArch64!") + } + EOL + GOARCH=arm64 go build hello.go + - + name: This would fail without docker/setup-qemu-action + run: ./hello + - + name: You can also run images from other platforms + run: docker run --platform linux/i386 hello-world ``` > [!NOTE]