Creating the Raw eLxr Edge OSTree Image¶
About This Task¶
With just a few commands you can create a raw eLxr Edge image, with full package management features, ready to run. You will first create the rucksack container, and then use it to build the raw image.
This is not a Docker image, but a development image you can deploy to hardware or through virtualization such as QEMU.
Before You Begin¶
You must have a project directory and the necessary Git repositories. For details, see Setting Up Your Development Environment for Distro-to-Order Image Builds.
You must have Python3 with rucksack and libvirt-dev modules installed on your Linux development host. For details, see elxr-overview.
Procedure¶
Navigate to the rucksack directory.
$ cd rucksack
Build the rucksack container.
$ ./tools/build-container.sh [+] Building 94.5s (11/11) FINISHED docker:default => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 1.21kB 0.0s => [internal] load metadata for docker.io/elxrlinux/elxr:latest 1.6s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [1/6] FROM docker.io/elxrlinux/elxr:latest@sha256:b28241bedf3c25bac5e00e232aeb9d3eaab79f1cb8a8abfcea83951d 5.5s => => resolve docker.io/elxrlinux/elxr:latest@sha256:b28241bedf3c25bac5e00e232aeb9d3eaab79f1cb8a8abfcea83951d 0.0s => => sha256:32c6ad8e16cab695895a840f5ab4a7ac960250ee3f93ea08036861ad70da12a3 93.39MB / 93.39MB 3.5s => => sha256:b28241bedf3c25bac5e00e232aeb9d3eaab79f1cb8a8abfcea83951d724d08b6 528B / 528B 0.0s => => sha256:ee31b9d6468f461cf0c5ef44d271ebef5f8883b2512c328dcbb97bd8ee47b18a 891B / 891B 0.0s => => extracting sha256:32c6ad8e16cab695895a840f5ab4a7ac960250ee3f93ea08036861ad70da12a3 1.8s => [internal] load build context 0.0s => => transferring context: 108B 0.0s => [2/6] RUN apt-get update && apt-get install -y --no-install-recommends arch-test dock 83.0s => [3/6] COPY files/pip.conf /etc/pip.conf 0.1s => [4/6] RUN pip install omegaconf --no-cache-dir 1.5s => [5/6] RUN mkdir -p /var/www/html && mkdir -p /usr/src 0.2s => [6/6] WORKDIR /usr/src 0.0s => exporting to image 2.6s => => exporting layers 2.5s => => writing image sha256:6de48ab6922744a0820ea9edee6f4410bccd6f3757b6d3cb69f41a6fe93196e5 0.0s => => naming to docker.io/library/rucksack
Once the build-container.sh script completes, the rucksack will be available as a docker image. To see basic image information, enter:
$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE rucksack latest 9e7d175201df 1 hour ago 1.2GB
Navigate up one directory. This is necessary to include all the required components in your development container in the next step.
$ cd ..
Run the rucksack container. Once the command completes, the prompt will change to indicate you are working as root inside the running container.
$ docker run -it --privileged -v $(pwd):/usr/src -v $(pwd)/data:/var/tmp/rucksack -v /var/run/docker.sock:/var/run/docker.sock -v /dev:/dev -v /run:/run -v /sys:/sys -v /var/tmp:/var/tmp rucksack root@e8945bda7678:/usr/src#
Inside the container, install pasha and rucksack. Both components are required to build the eLxr raw image.
Note
The actual command to use begins after the # below.
root@e8945bda7678:/usr/src# PBR_VERSION=1.2.3 pip3 install -e pasha/. root@e8945bda7678:/usr/src# PBR_VERSION=1.2.3 pip3 install -e rucksack/.
Build the eLxr image with rucksack (rs) in the container.
This example uses the vm/minimal/image-ostree.yml file in the repository to define the image configuration. You can update the file or create your own to specify what you want to include in your eLxr image. For example, to create an image without OSTree support, use vm/minimal/image.yml
Note
This command may take some time to complete, based on your system resources.
root@e8945bda7678:/usr/src# rs build --debug -C elxr-config/vm/minimal/image-ostree.yaml --- Lots of output --- 2025-06-07 00:04:58,964: Running Undeploy on /dev/loop15. 2025-06-07 00:04:58,966: Running undeploy. 2025-06-07 00:04:58,966: Unmounting /dev/loop15. 2025-06-07 00:04:58,966: Running systemd-dissect -u /var/tmp/rucksack/elxr-minimal-amd64/rootfs 2025-06-07 00:04:59,623: Running Compress image /usr/src/elxr-minimal-ostree-amd64-12.10.0.0-amd64.img 2025-06-07 00:04:59,625: Compress /usr/src/elxr-minimal-ostree-amd64-12.10.0.0-amd64.img. 2025-06-07 00:04:59,625: Compress /usr/src/elxr-minimal-ostree-amd64-12.10.0.0-amd64.img. 2025-06-07 00:04:59,625: Running None 2025-06-07 00:05:00,787: /usr/src/elxr-minimal-ostree-amd64-12.10.0.0-amd64.img : 7.09% ( 4.00 GiB => 291 MiB, /usr/src/elxr-minimal-ostree-amd64-12.10.0.0-amd64.img.zst)
Exit from the build container and return to the host system.
root@e8945bda7678:/usr/src# exit $
Verify that the new system image files are available.
$ ls -l elxr-ostree-12.10.0.0-amd64.tar.gz elxr-minimal-ostree-amd64-12.10.0.0-amd64.img elxr-minimal-ostree-amd64-12.10.0.0-amd64.img.zst
Results¶
Now that you have a raw eLxr Edge image, you can boot it to begin your development work. For details, see Booting the Raw eLxr Edge Image.