Build customized arm images with docker
2.2K
For easily build your image we have created a docker image. The only thing you need to install is docker and docker-compose. You have the possibility to build the docker image yourself or download the image from docker hub. The prebuilt docker images are available for the following architectures:
Here you find the image on the docker-hub:
We will provide two different tags:
latest --> for cross compiling on amd64 or arm64 native --> for native compiling on arm64
Docker and docker-compose are for following operating systems available:
You will find how to install docker and docker-compose for your operating system here:
https://docs.docker.com/get-docker/
The official instruction for installing docker-compose on arm devices isnt working sometimes.
You can follow this guide for the installation: https://dev.to/rohansawant/installing-docker-and-docker-compose-on-the-raspberry-pi-in-5-simple-steps-3mgl
If you got some problems at using for compiling the image or the docker container you should install the following on your host system:
sudo apt install qemu-user-static #debian/ubuntu
sudo pacman -S qemu aarch64-linux-gnu-gcc qemu-arch-extra #arch(aur must be maybe enabled)
if there are still problems run the follwing command:
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
git clone https://github.com/ptr1337/arm-img-builder-docker
or create the docker-compose.yml:
version: '3.6'
services:
arm-img-builder:
# build: . #uncomment for building
image: pttrr/arm-img-builder:latest (for crosscompiling)
# image: pttrr/arm-img-builder:native (if building on a arm64 with docker)
privileged: true
container_name: arm-img-builder
stdin_open: true
tty: true
# restart: always
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /dev:/dev
- ./:/images
:latest is for cross compiling on your amd64 and arm64 :native is for native compiling on arm64
docker-compose pull && docker-compose up -d
If your container is successfully started you have to exec into it:
docker exec -it arm-img-builder bash
We also created a "docker-helper" which is aimed for guys which not using docker that often or never used it. Just check this link:
https://wiki.arm-image-builder.xyz/en/docker-addon
Just run in the /build dir following commands (mostly they should do the commands if enterying the container but for going sure):
make pull # Pulling latest updates from the builder
make update # Updating scripts and the makefile
Then enter in your wanted builder directory and follow the commands which you will find here:
raspberry-image-builder debian-image-builder
When your image built, you just have to move your to the /image directory, for example:
mv *.img.xz /images
Then you will find the image where you started the docker-compose.
For clearing up your directory and built cache in the container you can use the following commands:
make cleanup
make purge
make purge-all
docker stop arm-img-builderdocker system prune -a --volumesFor more information watch at our Wiki or GitHub.
Should you come across any bugs, feel free to either open an issue on GitHub or talk with us directly by joining our channel on Freenode; #debianarm-port
Content type
Image
Digest
Size
314.9 MB
Last updated
over 4 years ago
docker pull pttrr/arm-img-builder:arm64