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

Procedure

  1. Navigate to the rucksack directory.

    $ cd rucksack
    
  2. Build the rucksack container.

    $ ./tools/build-container.sh
    
    [+] Building 1.0s (12/12) FINISHED                               docker:default
    => [internal] load build definition from Dockerfile                       0.0s
    => => transferring dockerfile: 1.21kB                                     0.0s
    => [internal] load metadata for docker.io/library/debian:bookworm         0.9s
    => [internal] load .dockerignore                                          0.0s
    => => transferring context: 2B                                            0.0s
    => [1/7] FROM docker.io/library/debian:bookworm@sha256:321341744acb788e2  0.0s
    => [internal] load build context                                          0.0s
    => => transferring context: 2.95kB                                        0.0s
    => CACHED [2/7] RUN apt-get update &&     apt-get install -y --no-instal  0.0s
    => CACHED [3/7] COPY files/pip.conf /etc/pip.conf                         0.0s
    => CACHED [4/7] COPY files/eLxr-base.asc /etc/apt/trusted.gpg.d/eLxr-bas  0.0s
    => CACHED [5/7] RUN pip install omegaconf --no-cache-dir                  0.0s
    => CACHED [6/7] RUN mkdir -p /var/www/html && mkdir -p /usr/src           0.0s
    => CACHED [7/7] WORKDIR /usr/src                                          0.0s
    => exporting to image                                                     0.0s
    => => exporting layers                                                    0.0s
    => => writing image sha256:90c8c268fc226ab3e875dd720e80a3c23d2124c211536  0.0s
    => => naming to docker.io/library/rucksack
    
  3. 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
    
  4. Navigate up one directory. This is necessary to include all the required components in your development container in the next step.

    $ cd ..
    
  5. 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#
    
  6. 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/.
    
  7. 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)
    
  8. Exit from the build container and return to the host system.

    root@e8945bda7678:/usr/src# exit
    
    $
    
  9. 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.