Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbmccoy committed Oct 4, 2024
1 parent 551baf6 commit a8c3236
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion examples/docker-cross-compile/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
# Cross-compilation using Docker

This example uses Docker to cross-compile images to different architectures, in this case, to the Raspberry Pi.
This example uses Docker to cross-compile to a different architecture, in this case, to the Raspberry Pi. To run this,

```console
pants package examples/docker-cross-compile::
```

This will build the docker cross compiler image and then compile the module, with a binary in `dist/examples.docker-cross-compile/hello-cross`. You can then copy this to an ARM64 machine running linux, e.g., a raspberry pi:

```console
export RPI_USER=username
export RPI_HOST=raspberry.local

scp -q dist/examples.docker-cross-compile/hello-cross ${RPI_USER}@${RPI_HOST}:/home/${RPI_USER}
ssh ${RPI_USER}@${RPI_HOST} -t './hello-cross'
```

You should see an output like
```
Successfully compiled for ARM architecture.
```

0 comments on commit a8c3236

Please sign in to comment.