Jump to content

Neon/Docker: Difference between revisions

From KDE Community Wiki
Jriddell (talk | contribs)
switch to invent.kde.org registry
Ashark (talk | contribs)
m Automatically redirect
Tag: New redirect
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
= KDE neon on Docker =
#REDIRECT [[Neon/Containers|KDE neon Containers]]
 
Do you want to test KDE applications from master without installing KDE neon Dev Unstable edition?  Maybe you have Dev Unstable edition installed but want to develop on your stable branch?  Maybe you like your [https://en.wikipedia.org/wiki/Larswm larswm] setup but wonder if Plasma is the desktop for you and are looking for an easy way to test it out?  KDE neon Docker images are the solution to quickly give you access to use or develop another branch without reinstalling your system or spending hours compiling.
 
[[File:Screenshot 20211110 195707.png|KDE running in container images|1080px|center|]]
 
The above screenshot shows a computer running its normal Plasma desktop with three KDE neon Docker containers.  One is a full Plasma session of KDE neon User Edition, one is a full Plasma session of KDE neon Developer Unstable edition and one is a single app from Developer Stable edition running Okular.
 
[https://invent.kde.org/neon/docker-images/container_registry KDE neon container registry on invent.kde.org]
 
KDE neon Docker Images comes in two variants each with the same Plasma editions as our archives. [https://invent.kde.org/neon/docker-images/container_registry/20 Plasma images (~2GB)] come with the same software as our installable ISOs, Plasma and minimal applications. [https://invent.kde.org/neon/docker-images/container_registry/21 All Applications images (~4GB)] come with all applications built on KDE neon. Note that all applications image may be outdated.
 
{| class="wikitable"
|+ Available flavours
|-
! Plasma minimal !! All applications
|-
| ''invent-registry.kde.org/neon/docker-images/plasma:unstable''  || ''invent-registry.kde.org/neon/docker-images/all:unstable''
|-
| ''invent-registry.kde.org/neon/docker-images/plasma:testing''    || ''invent-registry.kde.org/neon/docker-images/all:testing''
|-
| ''invent-registry.kde.org/neon/docker-images/plasma:user''      || ''invent-registry.kde.org/neon/docker-images/all:user''
|-
| ''invent-registry.kde.org/neon/docker-images/plasma:developer''  || ''invent-registry.kde.org/neon/docker-images/all:developer''
|}
 
Default user is ''neon'' and password is blank. The user has password-free sudo access.
=== Dependencies & Setup ===
Before starting you need to make sure you have docker, ruby, ruby development, and xephyr installed on your system
{{Input|1=<nowiki>
#Ubuntu-based systems
sudo apt install docker.io ruby-dev xserver-xephyr
#rpm-based systems (tested on fedora)
sudo dnf install docker ruby-devel xorg-x11-server-Xephyr
</nowiki>}}
 
To give it a try first set up Docker as you would for your distro
{{Input|1=<nowiki>
sudo usermod -aG docker $(whoami)
newgrp docker
sudo systemctl unmask docker.service
sudo systemctl unmask docker.socket
sudo systemctl start docker.service</nowiki>}}
 
This will download the latest unstable image from Docker Hub:
{{Input|1=<nowiki>
docker pull invent-registry.kde.org/neon/docker-images/plasma:unstable</nowiki>}}
 
The neondocker or x11docker [https://github.com/mviereck/x11docker] script lets you run Neon docker images easily, this is pre-installed on recent KDE neon installs but works on any distro
 
{{Input|1=<nowiki>
wget https://invent.kde.org/packaging/docker-neon/-/raw/master/neondocker/neondocker.rb -O neondocker
chmod +x neondocker
sudo gem install --version '2.2.0' docker-api</nowiki>}}
 
=== Running KDE neon on Docker ===
By default it will run a full session inside a Xephyr window.
{{Input|1=<nowiki>
./neondocker</nowiki>}}
 
Or you can tell it to run a single app
{{Input|1=<nowiki>
./neondocker okular</nowiki>}}
 
This will give you a Bash prompt, you can code as you would on your host machine and run X apps.  Type ''exit'' to quit, the ~/src directory will be preserved on your host machine.
 
For a Wayland session running in a window under either X or Wayland run.  (This seems to stop any more X apps running though, spooky.)
 
{{Input|1=<nowiki>
./neondocker -w</nowiki>}}
 
=== Tips on using neondocker script ===
* For more help using neondocker:{{Input|1=<nowiki>./neondocker --help</nowiki>}}
* For the container to persist after you have closed the window add <code>-k</code>
* To update to the latest build add  <code>-p</code>
* To use the Neon All build which has more apps add <code>-a</code>
* To run a different edition add <code>-e unstable/plasma_lts</code>
 
<br>
 
You can also commit your Docker images if you make changes you would like to come back to such as installing applications. For more information on using Docker see [https://docs.docker.com/engine/userguide/ Docker Engine user guide.]
 
For an interactive session where you have access to your coding directory <code>~/src run</code>
 
{{Input|1=<nowiki>
xhost +
docker run -ti -v /tmp/.X11-unix:/tmp/.X11-unix -v ~/src:/home/neon/src -e DISPLAY=:0 invent-registry.kde.org/neon/docker-images/plasma:unstable bash</nowiki>}}

Latest revision as of 17:37, 13 March 2024

Redirect to: