<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Developer – Containers</title><link>/docs/getting-started/building/containers/</link><description>Recent content in Containers on Developer</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/getting-started/building/containers/index.xml" rel="self" type="application/rss+xml"/><item><title>Docs: Building KDE software with distrobox and podman</title><link>/docs/getting-started/building/containers/distrobox/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/getting-started/building/containers/distrobox/</guid><description>
&lt;p&gt;If you use a really old Linux distribution that does not have the base system dependencies needed for kde-builder like an older long term support distribution such as &lt;a href="https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux" &gt;RHEL&lt;/a&gt;, or use an immutable distribution like &lt;a href="https://en.opensuse.org/Portal:Kalpa" &gt;openSUSE Kalpa&lt;/a&gt;, &lt;a href="https://fedoraproject.org/atomic-desktops/kinoite/" &gt;Fedora Kinoite&lt;/a&gt; or the &lt;a href="https://store.steampowered.com/steamdeck" &gt;SteamOS on the Steam Deck&lt;/a&gt;, you will not be able to build KDE software directly with &lt;a href="/docs/getting-started/building/kde-builder/kde-builder-setup/" &gt;kde-builder&lt;/a&gt; or &lt;a href="/docs/getting-started/building/manual-build/cmake-build/" &gt;manually with CMake&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Instead, you can build KDE software inside a container. Distrobox eases the container development workflow by letting you run commands inside the container while still able to see your home directory by default.&lt;/p&gt;
&lt;p&gt;Additionally, distrobox has the ability to run graphical applications from within the container.&lt;/p&gt;
&lt;p&gt;You will be able to run &lt;a href="#kde-builder" &gt;kde-builder inside a container&lt;/a&gt; just fine, with the caveat that you won’t be able to run a Plasma Desktop session from the login screen.&lt;/p&gt;
&lt;p&gt;You can also build KDE software by &lt;a href="/docs/getting-started/building/manual-build/cmake-build/" &gt;running CMake commands inside the container&lt;/a&gt; just like you would outside the container.&lt;/p&gt;
&lt;h2 id="setup"&gt;Setting up distrobox&lt;/h2&gt;
&lt;p&gt;If your Linux distribution is &lt;em&gt;not&lt;/em&gt; immutable, install distrobox and podman from your distribution repositories:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Debian/Ubuntu: &lt;code&gt;sudo apt install distrobox podman&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;openSUSE: &lt;code&gt;sudo zypper install distrobox podman&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Fedora: &lt;code&gt;sudo dnf install distrobox podman&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Arch: &lt;code&gt;sudo pacman --sync distrobox podman&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On immutable distributions like openSUSE Kalpa, Fedora Kinoite, and SteamOS on the Steam Deck) you should already have both podman and distrobox available by default.&lt;/p&gt;
&lt;p&gt;If you experience any problems, need a more up-to-date version, or your chosen distribution lacks distrobox, you can use an &lt;a href="https://distrobox.it/#alternative-methods" &gt;official alternative method&lt;/a&gt; to install distrobox:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install &lt;span class="p"&gt;|&lt;/span&gt; sh -s -- --prefix ~/.local&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;On the Steam Deck, you will additionally need to add &lt;code&gt;~/.local/bin&lt;/code&gt; to the &lt;code&gt;$PATH&lt;/code&gt; in your &lt;code&gt;.bashrc&lt;/code&gt; (or equivalent in your preferred shell):&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;:~/.local/bin&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And add the following to a new file &lt;code&gt;~/.config/distrobox/distrobox.conf&lt;/code&gt;. It will allow to run graphical applications directly from the distrobox:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;xhost +si:localuser:&lt;span class="nv"&gt;$USER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="kde-builder"&gt;Building KDE software with distrobox + kde-builder&lt;/h2&gt;
&lt;p&gt;Since &lt;a href="/docs/getting-started/building/kde-builder/kde-builder-setup/" &gt;kde-builder&lt;/a&gt; allows to build the most bleeding edge KDE software and its dependencies, all you need to build is a sufficiently up-to-date distribution. In this case it is sufficient to use standard &lt;a href="https://hub.docker.com/r/opensuse/tumbleweed/" &gt;openSUSE Tumbleweed&lt;/a&gt;, &lt;a href="https://hub.docker.com/_/fedora/" &gt;Fedora&lt;/a&gt;, or &lt;a href="https://hub.docker.com/_/archlinux" &gt;Arch Linux&lt;/a&gt; containers.&lt;/p&gt;
&lt;p&gt;After having installed distrobox, run &lt;em&gt;only one&lt;/em&gt; of the following commands to create a new distrobox image:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;openSUSE Tumbleweed: &lt;code&gt;distrobox create --image docker.io/opensuse/tumbleweed --name opensuse&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Fedora: &lt;code&gt;distrobox create --image docker.io/fedora --name fedora&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Arch Linux: &lt;code&gt;distrobox create --image docker.io/archlinux --name arch&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Distrobox will tell podman to pull the images from Dockerhub, create an appropriate container, and name it as specified in the command.&lt;/p&gt;
&lt;p&gt;After it is finished, run the following:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;distrobox enter &amp;lt;containername&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Distrobox will take some time to configure the container the first time, and then you will automatically enter the container.&lt;/p&gt;
&lt;p&gt;Inside the container you will now have access to development packages like git, CMake, KDE frameworks libraries and other such things.&lt;/p&gt;
&lt;p&gt;Follow the &lt;a href="/docs/getting-started/building/kde-builder/kde-builder-setup/" &gt;tutorial for setting up kde-builder&lt;/a&gt; and the experience should be the same as if you were following the kde-builder tutorial in a non-immutable Linux distribution.&lt;/p&gt;
&lt;p&gt;Whenever you want to get back to developing with kde-builder inside the container, remember to use the above &lt;code&gt;distrobox enter &amp;lt;containername&amp;gt;&lt;/code&gt; command to enter the container &lt;em&gt;before&lt;/em&gt; building or running the application.&lt;/p&gt;
&lt;p&gt;From this point on, the &lt;a href="/docs/getting-started/building/kde-builder/kde-builder-setup/" &gt;kde-builder tutorial&lt;/a&gt; should be followed instead.&lt;/p&gt;
&lt;p&gt;Note that the container size will stay relatively tiny, but kde-builder will require as much disk space as necessary to build the software you specify and all its dependencies.&lt;/p&gt;
&lt;div class="d-flex align-items-center notecard notecard--warning" role="alert"&gt;
&lt;span&gt;
&lt;p class="h4 mt-0"&gt;About the Arch container image&lt;/p&gt;&lt;p&gt;By default, Distrobox uses &lt;a href="https://distrobox.it/usage/distrobox-host-exec/" &gt;host-exec&lt;/a&gt; in the Arch Linux image to allow to run flatpak applications on the host while inside the container by creating a symlink to flatpak in &lt;code&gt;/usr/bin/flatpak&lt;/code&gt; in the container.&lt;/p&gt;
&lt;p&gt;This causes kde-builder to fail to install the Arch flatpak binary during initial setup.&lt;/p&gt;
&lt;p&gt;To work around this issue, first delete &lt;code&gt;/usr/bin/flatpak&lt;/code&gt; in the container, then run &lt;code&gt;kde-builder --install-distro-packages&lt;/code&gt;.&lt;/p&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;h2 id="with-cmake"&gt;Building KDE software with distrobox + manual compilation&lt;/h2&gt;
&lt;p&gt;In certain cases you may find &lt;a href="/docs/getting-started/building/kde-builder/kde-builder-setup/" &gt;kde-builder&lt;/a&gt; to be overkill for what you want to do, for example if you just intend on working on a specific desktop application. You might otherwise be restricted by storage space and cannot afford to compile dozens of projects just to build the one project you want.&lt;/p&gt;
&lt;p&gt;While containers also require a significant amount of storage, they often require much less than kde-builder.&lt;/p&gt;
&lt;h3 id="for-non-bleeding-edge-software"&gt;For non-bleeding edge software&lt;/h3&gt;
&lt;p&gt;You can use sufficiently up-to-date containers like &lt;a href="https://hub.docker.com/r/opensuse/tumbleweed/" &gt;openSUSE Tumbleweed&lt;/a&gt;, &lt;a href="https://hub.docker.com/_/fedora/" &gt;Fedora&lt;/a&gt;, or &lt;a href="https://hub.docker.com/_/archlinux" &gt;Arch Linux&lt;/a&gt; to develop KDE software, as long as the software does not have bleeding edge dependencies.&lt;/p&gt;
&lt;p&gt;After having installed distrobox, run &lt;em&gt;only one&lt;/em&gt; of the following commands to create a new distrobox image:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;openSUSE Tumbleweed: &lt;code&gt;distrobox create --image docker.io/opensuse/tumbleweed --name opensuse&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Fedora: &lt;code&gt;distrobox create --image docker.io/fedora --name fedora&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Arch Linux: &lt;code&gt;distrobox create --image docker.io/archlinux --name arch&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Distrobox will tell podman to pull the images from Dockerhub, create an appropriate container, and name it as specified in the command.&lt;/p&gt;
&lt;p&gt;After it is finished, run the following:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;distrobox enter &amp;lt;containername&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then you can proceed to start building KDE software using our guide on &lt;a href="/docs/getting-started/building/manual-build/cmake-build/" &gt;building KDE software manually with CMake&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="for-bleeding-edge-software"&gt;For bleeding edge software&lt;/h3&gt;
&lt;p&gt;Some KDE software, such as &lt;a href="https://apps.kde.org/itinerary/" &gt;Itinerary&lt;/a&gt; or &lt;a href="https://apps.kde.org/neochat/" &gt;Neochat&lt;/a&gt;, has &lt;em&gt;very&lt;/em&gt; rapid development and will require bleeding edge dependencies, in which case the above distribution containers will not suffice. To avoid having to compile and manage dependencies yourself, you can use containers that already come with KDE libraries built from the latest master branch.&lt;/p&gt;
&lt;p&gt;There are two main ones:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://community.kde.org/Neon/Containers" &gt;KDE neon Unstable&lt;/a&gt;, which already comes ready to use&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.opensuse.org/SDB:KDE_repositories" &gt;openSUSE Krypton&lt;/a&gt;, which needs to be manually added to an existing openSUSE Tumbleweed container&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;KDE neon Unstable is more straightforward to use since there is an official container built for it already.&lt;/p&gt;
&lt;p&gt;openSUSE Krypton has a simple unofficial image maintained by a contributor, but no official image from upstream.&lt;/p&gt;
&lt;p&gt;For KDE neon Unstable, run the following:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;distrobox create --image invent-registry.kde.org/neon/docker-images/plasma:unstable
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;distrobox enter plasma-unstable&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;For openSUSE Krypton, run the following:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;distrobox create --image codeberg.org/herzenschein/tumbleweed-krypton:latest --name krypton
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;distrobox enter krypton&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can then start building KDE software using our guide on &lt;a href="/docs/getting-started/building/manual-build/cmake-build/" &gt;building KDE software manually with CMake&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Note that the plasma-unstable image size is 5.6 GiB and the krypton image is 3 GiB and they can grow over time, so plan your disk space accordingly.&lt;/p&gt;
&lt;p&gt;If you'd like to build your own openSUSE Krypton image, you can either use the &lt;a href="https://codeberg.org/herzenschein/container-manifests/src/branch/master/qt6/tumbleweed-krypton" &gt;manifest for the above image&lt;/a&gt; or manually configure an existing Tumbleweed image:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;distrobox create --image docker.io/opensuse/tumbleweed --name krypton
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;distrobox enter krypton&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After that, follow &lt;a href="https://en.opensuse.org/SDB:KDE_repositories#Adding_these_repos_to_an_existing_installation" &gt;openSUSE’s instructions on adding builds from git master on Tumbleweed&lt;/a&gt;, using &lt;code&gt;sudo&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo zypper addrepo --refresh --priority &lt;span class="m"&gt;75&lt;/span&gt; https://download.opensuse.org/repositories/KDE:/Unstable:/Qt/openSUSE_Tumbleweed/ KDE:Unstable:Qt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo zypper addrepo --refresh --priority &lt;span class="m"&gt;75&lt;/span&gt; https://download.opensuse.org/repositories/KDE:/Unstable:/Frameworks/openSUSE_Factory/ KDE:Unstable:Frameworks
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo zypper addrepo --refresh --priority &lt;span class="m"&gt;75&lt;/span&gt; https://download.opensuse.org/repositories/KDE:/Unstable:/Applications/KDE_Unstable_Frameworks_openSUSE_Factory/ KDE:Unstable:Applications
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo zypper addrepo --refresh --priority &lt;span class="m"&gt;75&lt;/span&gt; https://download.opensuse.org/repositories/KDE:/Unstable:/Extra/KDE_Unstable_Frameworks_openSUSE_Factory/ KDE:Unstable:Extra
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo zypper --verbose dist-upgrade --allow-vendor-change&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The prepended &lt;code&gt;sudo&lt;/code&gt; is necessary to make sure the packages get installed in the container. The instructions above are the same as the openSUSE ones, but with long flags to make the command clearer.&lt;/p&gt;
&lt;p&gt;After the distribution upgrade inside the container, Tumbleweed will have turned into Krypton.&lt;/p&gt;
&lt;p&gt;If the distribution upgrade process asks you too many questions to resolve, you can press &lt;code&gt;Ctrl + C&lt;/code&gt; to cancel it and repeat the last command with an added &lt;code&gt;--force-resolution&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo zypper --verbose dist-upgrade --allow-vendor-change --force-resolution&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can now finally start building KDE software using our &lt;a href="/docs/getting-started/building/manual-build/cmake-build/" &gt;guide on building KDE software manually with CMake&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="limitations-of-using-containers"&gt;Limitations of using containers&lt;/h2&gt;
&lt;p&gt;Containers are typically designed to be lean, not to provide a full desktop experience. As such, they usually do not come with software that would otherwise come preinstalled in typical desktop systems, and so you will often need to search manually for the missing software.&lt;/p&gt;
&lt;p&gt;For that, we have a &lt;a href="/docs/getting-started/building/help/dependencies/" &gt;tutorial on installing missing build dependencies&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In addition to this, there are a few pieces of software with very common use cases that can be missing from containers by default:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;qqc2-desktop-style, for QtQuick/Kirigami applications to use the correct Breeze theme&lt;/li&gt;
&lt;li&gt;breeze and breeze-icons, for theme support&lt;/li&gt;
&lt;li&gt;the QtWayland development library, for applications inside the container to run as native Wayland windows&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Another limitation is the inability to &lt;a href="/docs/getting-started/building/kde-builder/kde-builder-compile/#plasma" &gt;run a full Plasma session built with kde-builder&lt;/a&gt; from inside containers. While this is &lt;a href="https://distrobox.it/posts/run_latest_gnome_kde_on_distrobox/" &gt;theoretically possible&lt;/a&gt;, it has not been tested or documented and it is unlikely to be supported.&lt;/p&gt;</description></item></channel></rss>