Base web image working
This commit is contained in:
parent
22362a3937
commit
336186d626
@ -27,7 +27,7 @@ ENV USER designer
|
||||
|
||||
# Add scripts
|
||||
RUN mkdir -p .scripts
|
||||
COPY --chown=designer:designer --chmod=755 scripts/klayout /home/designer/.scripts
|
||||
COPY --chown=designer:designer --chmod=755 scripts/* /home/designer/.scripts
|
||||
ENV PATH="/home/designer/.scripts:${PATH}"
|
||||
|
||||
# Initialize the enviroment keeping container alive
|
||||
|
@ -9,23 +9,28 @@ RUN sudo pacman -Syuq --noconfirm
|
||||
RUN paru -S --noconfirm kasmvncserver-bin
|
||||
|
||||
# KASM requires the hostname binary to start
|
||||
RUN pacman -S --noconfirm inetutils
|
||||
RUN sudo pacman -S --noconfirm inetutils
|
||||
|
||||
# KASM requires the "snakeoil" certificate key for SSL authentication
|
||||
# This key comes from default in debian based distributions
|
||||
# For archlinux this will need to be created manually
|
||||
WORKDIR /etc/ssl
|
||||
RUN sudo openssl genpkey -algorithm RSA -out private/ssl-cert-snakeoil.key
|
||||
RUN sudo openssl req -new -key private/ssl-cert-snakeoil.key -out certs/ssl-cert-snakeoil.csr -subj "CN=localhost"
|
||||
RUN sudo openssl req -new -key private/ssl-cert-snakeoil.key -out certs/ssl-cert-snakeoil.csr -subj "/CN=localhost"
|
||||
RUN sudo openssl x509 -req -days 365 -in certs/ssl-cert-snakeoil.csr -signkey private/ssl-cert-snakeoil.key -out certs/ssl-cert-snakeoil.pem
|
||||
RUN sudo chmod 640 private/ssl-cert-snakeoil.key
|
||||
RUN sudo chmod 644 certs/ssl-cert-snakeoil.pem
|
||||
RUN sudo usermod -aG root designer
|
||||
|
||||
# Set desktop wallpaper
|
||||
RUN mkdir /home/designer/.media
|
||||
COPY media/defaultwallpaper.png /home/designer/.media
|
||||
RUN setwallpaper /home/designer/.media/defaultwallpaper.png
|
||||
# Install XFCE
|
||||
RUN sudo pacman -S --noconfirm xorg xfce4
|
||||
|
||||
# Run VNC server & desktop environment
|
||||
CMD["vncserver", "-select-de", "xfce"]
|
||||
# Copy includes
|
||||
RUN mkdir -p /home/designer/.media
|
||||
COPY --chown=designer:designer include/media/* /home/designer/.media
|
||||
RUN mkdir -p /home/designer/.config/autostart
|
||||
COPY --chown=designer:designer include/desktopinit.desktop /home/designer/.config/autostart
|
||||
|
||||
# Start VNC & desktop environment
|
||||
WORKDIR /home/designer
|
||||
ENTRYPOINT ["startserver"]
|
4
include/desktopinit.desktop
Normal file
4
include/desktopinit.desktop
Normal file
@ -0,0 +1,4 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=OSICStacks-DesktopInit
|
||||
Exec=sh -c "sleep 1 && desktopinit"
|
Before Width: | Height: | Size: 744 KiB After Width: | Height: | Size: 744 KiB |
2
scripts/desktopinit
Normal file
2
scripts/desktopinit
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
setwallpaper /home/designer/.media/defaultwallpaper.png
|
16
scripts/startserver
Normal file
16
scripts/startserver
Normal file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
cd /home/designer
|
||||
|
||||
# Run VNC server
|
||||
export DISPLAY=:1
|
||||
eval $(vncserver -dry-run) &
|
||||
echo -e "password\npassword\n" | vncpasswd -u designer -w -r
|
||||
|
||||
# Wait for VNC server to start
|
||||
sleep 1
|
||||
|
||||
# Run desktop environment (XFCE)
|
||||
xfce4-session --display=$DISPLAY
|
||||
|
||||
# Keep container alive
|
||||
sleep infinity
|
Loading…
Reference in New Issue
Block a user