Setting Up Your Development Environment for Distro-to-Order Image Builds¶
About This Task¶
Before you can create a D2O eLxr 26.04 image, you must set up your development environment as described in this procedure. This includes adding the necessary packages, cloning the d2o-tools repository, and building the local/d2o podman container image. Once complete, you will be able to create and build an eLxr image with just a few commands.
Before You Begin¶
You must have a Linux development host with the minimum requirements. For details, see Quick Start Overview.
You must have Python3 with libvirt-dev modules installed on your Linux development host. For details, see Quick Start Overview.
Procedure¶
Install the required packages to support the localhost/d2o container build.
$ sudo apt-get install -y podman qemu-system-x86 ovmf just
Create an eLxr project directory.
$ mkdir -p elxr-dev && cd elxr-dev
Clone the d2o-tool development repository.
$ git clone git@gitlab.com:elxr/tools/d2o/d2o-tool.git
Verify the cloned directories.
$ ls d2o-tool ci Containerfile LICENSE pyproject.toml requirements.txt test-requirements.txt variants ci-requirements.txt Justfile MANIFEST.in README.md src tox.ini
Navigate to the d2o-tool directory.
$ cd d2o-tool
Build the localhost/d2o container.
This build creates the podman localhost/d2o container image and builds the d2o binaries.
Note
This is only required the first time you clone the repository. Once you build the container, you can develop in the repository folder as long as the localhost/d2o podman image exists. See the next step for verification.
$ just build-container ---- lots of output ---- Successfully built d2o Installing collected packages: d2o Successfully installed d2o-0.0.0 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. --> a61b6edc08a1 STEP 9/9: ENTRYPOINT ["/usr/local/bin/d2o" ] COMMIT d2o --> 4b22f1c4a316 Successfully tagged localhost/d2o:latest
Once the build completes, the localhost/d2o will be available as a podman image. To see basic image information, enter:
$ sudo podman images REPOSITORY TAG IMAGE ID CREATED SIZE localhost/d2o latest c1906884ab01 46 minutes ago 8.3 GB This new podnam image essentially creates the build environment from your cloned **d2o-tool** repository and integrates the **d2o** binary for image builds and distro to order development. As long as the image is available, the development environment is ready.
Results¶
Now that your project directory has the necessary Git repository and localhost/d2o image, you can use it to create the eLxr image with a couple commands. For details, see Quick Start: Building and Customizing a Distro to Order Image.