An easy-to-use all-in-one cross compiler for the Raspberry Pi.
- Docker Registry @monstrenyatko/rpi-cross-compiler
- GitHub @monstrenyatko/docker-rpi-cross-compiler
- Fork of GitHub @sdt/docker-raspberry-pi-cross-compiler
- Toolchain: arm-rpi-4.9.3-linux-gnueabihf
- Raspbian sysroot: 2015.05.05
- Easy installation of Raspbian packages into the sysroot using the qemu arm emulator
- Easy-to-use front end wrapper program
rpxc
- Boost 1.55 C++ libraries
libssl-dev
. See OpenSSLlibjansson-dev
. See Jansson
This image is not intended to be run manually. Instead, there is a helper script which comes bundled with the image.
To install the helper script, run the image with no arguments, and redirect the output to a file.
eg.
docker run monstrenyatko/rpi-cross-compiler > ~/bin/rpxc
chmod +x ~/bin/rpxc
rpxc [command] [args...]
Execute the given command-line inside the container.
If the command matches one of the rpxc
built-in commands (see below), that will be executed locally, otherwise the command is executed inside the container.
rpxc -- [command] [args...]
To force a command to run inside the container (in case of a name clash with a built-in command), use --
before the command.
rpxc install-debian [--update] package packages...
Install native packages into the docker image. Changes are committed back to the image.
rpxc install-raspbian [--update] package packages...
Install Raspbian packages from the Raspbian repositories into the sysroot of the docker image. Changes are committed back to the image.
rpxc update-image
Pull the latest version of the docker image.
If a new docker image is available, any extra packages installed with install-debian
or install-raspbian
will be lost.
rpxc update-script
Update the installed rpxc
script with the one bundled in the image.
rpxc update
Update both the docker image and the rpxc
script.
The following command-line options and environment variables are used. In all cases, the command-line option overrides the environment variable.
This file is sourced if it exists.
Default: ~/.rpxc
The docker image to run.
Default: monstrenyatko/rpi-cross-compiler
Extra arguments to pass to the docker run
command.
Using rpxc install-debian
and rpxc install-raspbian
are really only intended for getting a build environment together.
Once you've figured out which Debian and Raspbian packages you need, it's better to create a custom downstream image
that has all your tools and development packages built in.
FROM monstrenyatko/rpi-cross-compiler
# Install some native build-time tools
RUN install-debian scons
# Install raspbian development libraries
RUN install-raspbian libboost-dev-all
export RPXC_IMAGE=my-custom-rpxc-image
docker build -t $RPXC_IMAGE .
# These are typical cross-compilation flags to pass to configure.
# Note the use of single quotes in the shell command-line. We want the
# variables to be interpolated in the container, not in the host system.
rpxc sh -c 'CFLAGS=--sysroot=$SYSROOT ./configure --host=$HOST'
rpxc make
Another way to achieve this is to create a shell script.
#!/bin/sh
CFLAGS=--sysroot=$SYSROOT ./configure --host=$HOST
make
And call it as rpxc -- ./mymake.sh