Sign inSign up

pttrr/arm-img-builder

By pttrr

•Updated over 4 years ago

Build customized arm images with docker

Image
1

2.2K

pttrr/arm-img-builder repository overview

arm-img-builder-docker

⁠Docker arm image builder

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:

  • amd64
  • arm64

Here you find the image on the docker-hub:

pttrr/arm-img-builder⁠

We will provide two different tags:

latest --> for cross compiling on amd64 or arm64 native --> for native compiling on arm64

⁠Installing docker and docker-compose

Docker and docker-compose are for following operating systems available:

  • Linux (all distros)
  • Mac
  • Windows

You will find how to install docker and docker-compose for your operating system here:

https://docs.docker.com/get-docker/⁠

⁠Install docker at raspberry or other arm devices

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⁠

⁠Torubleshooting if building the image is failing

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

⁠Usage

⁠Clone my repo
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
⁠Change the image tag to your needs.

:latest is for cross compiling on your amd64 and arm64 :native is for native compiling on arm64

⁠Pulling and start the container
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
⁠Docker-Addon

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⁠

⁠Supported Builder

⁠Usage inside the container

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⁠

⁠Moving image to the host system

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.

⁠Maintenance and Troubleshooting

⁠Cleanup

For clearing up your directory and built cache in the container you can use the following commands:

make cleanup
make purge
make purge-all
⁠Clearing the complete docker system
  1. Stop your running container with docker stop arm-img-builder
  2. Then run docker system prune -a --volumes

⁠Support

For 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⁠

Tag summary

Content type

Image

Digest

Size

314.9 MB

Last updated

over 4 years ago

docker pull pttrr/arm-img-builder:arm64