Initial - working container.

This commit is contained in:
Jakub Wiewiora
2024-11-09 18:28:47 +01:00
commit 5721df5f8e
15 changed files with 234 additions and 0 deletions

17
README Normal file
View File

@@ -0,0 +1,17 @@
# DockerRDP
Runs RDP server with XFCE4 enviroment in Docker container.
## Running container
You can run it using following command or use attached `pod.yaml` to run that pod on K8s cluster.
```
docker run --rm -itd -p 3389:3389 DockerRDP
```
## Connecting
Default user is named `user` and its password is set to `user`, there's also sudo rule granting him full rights without password.
## Building container
```
docker build -t DockerRDP.
```

26
container/Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
FROM debian:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y supervisor xfce4 xrdp dbus-x11 firefox-esr xfce4-terminal sudo nano; apt clean
# Customize internal desktop
COPY customize/xfce4 /etc/skel/.config/xfce4/
# Create user account
RUN addgroup admin; useradd -m -d /home/user -s /bin/bash -G sudo,admin user
RUN echo 'user:user' | chpasswd
# DBus config
RUN mkdir -p /var/run/dbus
RUN chown messagebus:messagebus /var/run/dbus
RUN dbus-uuidgen > /var/lib/dbus/machine-id
# Sudo config
COPY sudo/* /etc/sudoers.d/*
# Supervisor config
COPY supervisord/* /etc/supervisor/conf.d/
CMD [ "/usr/bin/supervisord", "-n", "-c/etc/supervisor/supervisord.conf" ]

Binary file not shown.

View File

@@ -0,0 +1,15 @@
[Desktop Entry]
Name=Firefox ESR
Comment=Browse the World Wide Web
GenericName=Web Browser
X-GNOME-FullName=Firefox ESR Web Browser
Exec=/usr/lib/firefox-esr/firefox-esr %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox-esr
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
StartupWMClass=firefox-esr
StartupNotify=true
X-XFCE-Source=file:///usr/share/applications/firefox-esr.desktop

View File

@@ -0,0 +1,13 @@
[Desktop Entry]
Version=1.0
Type=Application
Exec=exo-open --launch TerminalEmulator
Icon=org.xfce.terminalemulator
StartupNotify=true
Terminal=false
Categories=Utility;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
X-AppStream-Ignore=True
Name=Terminal Emulator
Comment=Use the command line
X-XFCE-Source=file:///usr/share/applications/xfce4-terminal-emulator.desktop

View File

@@ -0,0 +1,14 @@
[Desktop Entry]
Version=1.0
Type=Application
Exec=exo-open --launch FileManager %u
Icon=org.xfce.filemanager
StartupNotify=true
Terminal=false
Categories=Utility;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
X-XFCE-MimeType=inode/directory;x-scheme-handler/trash;
X-AppStream-Ignore=True
Name=File Manager
Comment=Browse the file system
X-XFCE-Source=file:///usr/share/applications/xfce4-file-manager.desktop

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-desktop" version="1.0">
<property name="backdrop" type="empty">
<property name="screen0" type="empty">
<property name="monitorrdp0" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="1"/>
<property name="image-style" type="int" value="0"/>
<property name="last-image" type="string" value="/usr/share/images/desktop-base/default"/>
</property>
</property>
</property>
<property name="single-workspace-mode" type="bool" value="true"/>
<property name="single-workspace-number" type="int" value="0"/>
</property>
</channel>

View File

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-panel" version="1.0">
<property name="configver" type="int" value="2"/>
<property name="panels" type="array">
<value type="int" value="1"/>
<property name="dark-mode" type="bool" value="true"/>
<property name="panel-1" type="empty">
<property name="position" type="string" value="p=6;x=0;y=0"/>
<property name="length" type="uint" value="100"/>
<property name="position-locked" type="bool" value="true"/>
<property name="icon-size" type="uint" value="16"/>
<property name="size" type="uint" value="26"/>
<property name="plugin-ids" type="array">
<value type="int" value="1"/>
<value type="int" value="15"/>
<value type="int" value="17"/>
<value type="int" value="16"/>
<value type="int" value="2"/>
<value type="int" value="3"/>
<value type="int" value="4"/>
<value type="int" value="5"/>
<value type="int" value="6"/>
<value type="int" value="10"/>
<value type="int" value="11"/>
<value type="int" value="12"/>
<value type="int" value="13"/>
<value type="int" value="7"/>
</property>
</property>
</property>
<property name="plugins" type="empty">
<property name="plugin-1" type="string" value="applicationsmenu">
<property name="button-title" type="string" value="Apps"/>
</property>
<property name="plugin-2" type="string" value="tasklist">
<property name="grouping" type="uint" value="1"/>
</property>
<property name="plugin-3" type="string" value="separator">
<property name="expand" type="bool" value="true"/>
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-4" type="string" value="pager">
<property name="rows" type="uint" value="1"/>
</property>
<property name="plugin-5" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-6" type="string" value="systray">
<property name="square-icons" type="bool" value="true"/>
</property>
<property name="plugin-10" type="string" value="notification-plugin"/>
<property name="plugin-11" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-12" type="string" value="clock"/>
<property name="plugin-13" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-7" type="string" value="actions">
<property name="appearance" type="uint" value="0"/>
<property name="items" type="array">
<value type="string" value="-lock-screen"/>
<value type="string" value="-switch-user"/>
<value type="string" value="-separator"/>
<value type="string" value="-suspend"/>
<value type="string" value="-hibernate"/>
<value type="string" value="-hybrid-sleep"/>
<value type="string" value="-separator"/>
<value type="string" value="-shutdown"/>
<value type="string" value="-restart"/>
<value type="string" value="-separator"/>
<value type="string" value="-logout"/>
<value type="string" value="+logout-dialog"/>
</property>
<property name="ask-confirmation" type="bool" value="true"/>
</property>
<property name="plugin-15" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="17311693981.desktop"/>
</property>
</property>
<property name="plugin-16" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="17311694032.desktop"/>
</property>
</property>
<property name="plugin-17" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="17311694113.desktop"/>
</property>
</property>
</property>
</channel>

1
container/sudo/admin-grp Normal file
View File

@@ -0,0 +1 @@
%admin ALL=(ALL:ALL) NOPASSWD: ALL

View File

@@ -0,0 +1,2 @@
[supervisord]
user=root

View File

@@ -0,0 +1,7 @@
[program:dbus]
command=/usr/bin/dbus-daemon --config-file=/usr/share/dbus-1/system.conf --nosyslog --nofork --nopidfile
user=root
priority=20
startsecs=3
autostart=true
autorestart=true

View File

@@ -0,0 +1,7 @@
[program:xrdp-sesman]
command=/usr/sbin/xrdp-sesman --nodaemon
user=root
priority=11
startsecs=3
autostart=true
autorestart=true

View File

@@ -0,0 +1,7 @@
[program:xrdp]
command=/usr/sbin/xrdp --nodaemon
user=root
priority=10
startsecs=3
autostart=true
autorestart=true

10
pod.yaml Normal file
View File

@@ -0,0 +1,10 @@
apiVersion: v1
kind: Pod
metadata:
name: DockerRDP
spec:
containers:
- name: DockerRDP
image: DockerRDP
ports:
- containerPort: 3389

4
todo Normal file
View File

@@ -0,0 +1,4 @@
# TODO
- make XRDP and SESMAN not log to conole
- create pod.yaml(with svc)
- maybe create user home at every start, so it is possible to mount a volume to it and persist data