-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
``` |