All Projects → dlecan → rust-crosscompiler-arm

dlecan / rust-crosscompiler-arm

Licence: MIT license
Docker images for Rust dedicated to cross compilation for ARM v6 and more

Projects that are alternatives of or similar to rust-crosscompiler-arm

alpine-qbittorrent-openvpn
qBittorrent docker container with OpenVPN client running as unprivileged user on alpine linux
Stars: ✭ 230 (+379.17%)
Mutual labels:  arm, armv7, armv6
docker-elasticsearch
Multi-architecture (arm, x86) Docker image for Elasticsearch
Stars: ✭ 14 (-70.83%)
Mutual labels:  arm, armv7, armv6
Gitlab
GitLab CE (Docker image) for ARM devices, this is a mirror repository of
Stars: ✭ 121 (+152.08%)
Mutual labels:  arm, raspberrypi, armv7
Raspberry Pi Cross Compilers
Latest GCC Cross Compiler & Native (ARM & ARM64) CI generated precompiled standalone toolchains for all Raspberry Pis. 🍇
Stars: ✭ 261 (+443.75%)
Mutual labels:  arm, raspberrypi, cross-compiler
Docker Jdownloader
JDownloader 2 Docker Image (Multiarch) - Passed 40M Downloads
Stars: ✭ 85 (+77.08%)
Mutual labels:  arm, raspberrypi, armv7
Shecc
A self-hosting and educational C compiler
Stars: ✭ 286 (+495.83%)
Mutual labels:  arm, armv7, cross-compiler
docker-nagios
Docker image for Nagios Core in Alpine Linux with basic plugins, available for x86, x64 , ARM v6, ARM v7 and ARM64.
Stars: ✭ 33 (-31.25%)
Mutual labels:  arm, armv7, armv6
Nwjs rpi
[NW.js port for Raspberry Pi] binary compiled for the ARMv6 used in Raspberry Pi (compatible with RPi 2 and RPi 3)
Stars: ✭ 91 (+89.58%)
Mutual labels:  arm, raspberrypi, armv7
alpine-php-fpm
Lightweight and optimised PHP-FPM (PHP 7.4, 8.0, 8.1) Docker images with essential extensions on top of latest Alpine Linux.
Stars: ✭ 53 (+10.42%)
Mutual labels:  arm, armv7, armv6
Piwheels
Python package repository providing wheels (pre-built binaries) for Raspberry Pi
Stars: ✭ 180 (+275%)
Mutual labels:  arm, raspberrypi
Ataraxia
Simple and lightweight source-based multi-platform Linux distribution with musl libc.
Stars: ✭ 226 (+370.83%)
Mutual labels:  arm, cross-compiler
discolix
distroless arm docker images
Stars: ✭ 22 (-54.17%)
Mutual labels:  arm, armv7
Computelibrary
The Compute Library is a set of computer vision and machine learning functions optimised for both Arm CPUs and GPUs using SIMD technologies.
Stars: ✭ 2,123 (+4322.92%)
Mutual labels:  arm, armv7
Arm Assembly Cheat
MOVED TO: https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly SEE README. ARMv7 and ARMv8 assembly userland minimal examples tutorial. Runnable asserts on x86 hosts with QEMU user mode or natively on ARM targets. Nice GDB step debug setup. Tested on Ubuntu 18.04 host and Raspberry Pi 2 and 3 targets.
Stars: ✭ 159 (+231.25%)
Mutual labels:  arm, armv7
Tow-Boot
An opinionated distribution of U-Boot. — https://matrix.to/#/#Tow-Boot:matrix.org?via=matrix.org
Stars: ✭ 338 (+604.17%)
Mutual labels:  arm, armv7
Synestiaos
The Synestia Operating System
Stars: ✭ 159 (+231.25%)
Mutual labels:  arm, armv7
Docker Homebridge
Homebridge Docker. HomeKit support for the impatient using Docker on x86_64, Raspberry Pi (armhf) and ARM64. Includes ffmpeg + libfdk-aac.
Stars: ✭ 1,847 (+3747.92%)
Mutual labels:  arm, armv6
elfloader
ARMv7M ELF loader
Stars: ✭ 71 (+47.92%)
Mutual labels:  arm, armv7
rasa-docker-arm
Rasa Docker image for ARMv7. Runs on a Raspberry Pi.
Stars: ✭ 19 (-60.42%)
Mutual labels:  arm, armv7
V60Mini-firmhack
A project to disassemble the KBParadise V60 Mini keyboard firmware.
Stars: ✭ 23 (-52.08%)
Mutual labels:  arm, armv7

Docker image for Rust crosscompilation dedicated to ARM architectures v6 and more

Build Status

Keywords: rust arm raspberrypi crosscompilation docker armv6 armv7

Public trusted images available on:

This repository is used to build a Docker image based on Debian for the Rust programming language for arm (eg. : all models of Raspberry Pi) architectures and a few supporting tools. The image includes :

  • rustc
  • rustdoc
  • cargo
  • git
  • SSL certificates
  • build essentials
  • Linaro cross compiler
  • many libraries compiled for arm

So it should be able to run cargo build on most projects out of the box. The path /source is a volume where you can mount a Cargo project from the host machine.

Docker image is automatically build and published once a week, so this "stable" rust compiler it is always update-to-date with the official one.

Sample

You can see this Docker image in action in this project: https://github.com/dlecan/generic-dns-update

Look at Travis build scripts.

Why ?

To setup a full cross-compiling environment is complicated. You need:

  • a build toolchain for armhf architecture : not available on Debian, but easy to install on Ubuntu
  • a Rust compiler for armhf architecture : no binaries are available, so you need to compile it from sources
  • to tell Cargo how to cross compile
  • many development libraries (headers + lib) such as openssl, compiled for arm architecture
  • ...

After that, if you succeed, your workstation will be a real mess.

So I created this Docker image dedicated to Rust cross-compilation on arm.

Usage

The following command will run cargo build --release with the current directory on the host shared, with Rust 'stable' channel:

docker run -it --rm \
  -v $(pwd):/source \
  dlecan/rust-crosscompiler-arm:stable

Rust 'target' architecture is forced to arm-unknown-linux-gnueabihf within the container (parameter target=arm-unknown-linux-gnueabihf automatically added).

If you want to run another command from within the container, add it at the end of the previous command line. For example, to display Cargo version:

docker run -it --rm \
  -v $(pwd):/source \
  dlecan/rust-crosscompiler-arm:stable \
  cargo --version

Optimized usage

With the previous configuration, Cargo dependencies will be downloaded and compiled again and again each time you launch the Docker container. If you want to avoid this behavior, you must persist Cargo cache folders within the container on the host. The best is to share them with the Cargo cache folders of the host.

So you can use the following command line:

docker run -it --rm \
  -v $(pwd):/source \
  -v ~/.cargo/git:/root/.cargo/git \
  -v ~/.cargo/registry:/root/.cargo/registry \
  dlecan/rust-crosscompiler-arm:stable

This will cache and share sources of Cargo dependencies and Rust built librairies. It assumes that your Cargo configuration is located in ~/.cargo.

Caveat: unfortunately, with configuration, ~.cargo files will be owned by root user, so you will have to chown them to be able to use Cargo in the host.

To sum up, here is the script I use, located in /usr/local/sbin/rxc (rust cross compiler):

#!/bin/bash

docker run -it --rm \
  -v $(pwd):/source \
  -v ~/.cargo/git:/root/.cargo/git \
  -v ~/.cargo/registry:/root/.cargo/registry \
  dlecan/rust-crosscompiler-arm:stable "$@"

sudo chown -R `stat -c %u:%g $HOME` $(pwd) ~/.cargo

You can then rxc cargo build.

Usage with script

Inspiration

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].