Cross-build Machinekit packages in Docker for `i386` and `armhf` using `gcc --sysroot`
4.4K
This builds Debian Docker images with tools and dependencies for
building/cross-building Machinekit packages. For cross-building
armhf, arm64 and i386 architectures, the image contains a
multistrap system root tree, and for native amd64 builds the image
contains needed dependencies and tools in the root filesystem.
Determine $TAG for the desired architecture and distro
combination. The format is $ARCH_$DISTRO, where $ARCH may be
one of amd64, i386, armhf, arm64; $DISTRO may be one of
8 for Jessie, 9 for Stretch, 10 for Buster;
e.g. TAG=armhf_10.
To build Machinekit in a Docker container with cross-build tools,
cd into a Machinekit source tree:
# Build source and binary packages for $TAG
scripts/build_docker -t $TAG -c deb
# Build amd64 binary-only packages (no source) for Jessie
scripts/build_docker -t amd64_8 -c deb -n
# Build amd64_10 (default) RIP build with regression tests
scripts/build_docker -c test
# Run command in container
scripts/build_docker -t $TAG bash -c 'echo $HOST_MULTIARCH'
amd64_*, the native architecture.git clean -xdfQuerying packages in the sysroot:
Package management commands require special incantations for
manipulating the multistrap filesystem. Run these inside the
container (see above build_docker -c command).
# Installed packages
dpkg-query --admindir=$DPKG_ROOT/var/lib/dpkg -p libczmq-dev
# Apt cache
apt-cache -o Dir::State=$DPKG_ROOT/var/lib/apt/ show libczmq-dev
Machinekit dependencies are auto-generated from the Machinekit source
tree debian/ directory. When those files are updated, the
configure and control.in files should be copied here.
cp $(MK_REPO)/debian/configure debian/
cp $(MK_REPO)/debian/control.in debian/
Build images locally with the supplied script, supplying the image name, e.g.:
./build.sh my_docker_id/mk-cross-builder:arm64_10
These images can be automatically build on Docker Hub, and be used in Travis CI to test Machinekit.
mk-cross-builder image buildsmk-cross-buildermk-cross-builder repository<arch>_<distro-ver> tag:
<arch>_<distro-ver> tagAutomated builds should now be triggered whenever a new commit is
pushed to the GitHub repository master branch.
machinekit-hal buildsSet up Travis CI to automatically build and test your GitHub
machinekit-hal repository.
machinekit-hal repository into your GitHub
accountmachinekit-hal repository
(click "Sync account" if it doesn't appear)
$IMAGE
environment variable
IMAGE<your_docker_hub_id>/mk-cross-builder$IMAGE, the default
dovetailautomata/mk-cross-builder images will be usedTravis CI should now begin building the repository. Every new commit pushed to GitHub will also trigger a new build.
Content type
Image
Digest
Size
603.5 MB
Last updated
almost 7 years ago
docker pull zultron/mk-cross-builder:i386_11