commit
0a85c61828
|
@ -0,0 +1,83 @@
|
|||
FROM codercom/enterprise-base:ubuntu
|
||||
|
||||
USER 0
|
||||
|
||||
ARG DEBCONF_NONINTERACTIVE_SEEN=true
|
||||
ARG DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
RUN echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
|
||||
echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
wget \
|
||||
unzip \
|
||||
zsh \
|
||||
supervisor \
|
||||
xorg \
|
||||
tigervnc-standalone-server \
|
||||
tigervnc-xorg-extension \
|
||||
tigervnc-viewer \
|
||||
ssh \
|
||||
xfce4 \
|
||||
xfce4-goodies \
|
||||
x11-apps \
|
||||
xterm \
|
||||
python-numpy \
|
||||
firefox \
|
||||
fonts-lyx
|
||||
|
||||
# Install quality of life packages.
|
||||
RUN yes | unminimize
|
||||
|
||||
# Remove packages which may not behave well in a VNC environment.
|
||||
RUN apt-get remove -y \
|
||||
xfce4-battery-plugin \
|
||||
xfce4-power-manager-plugins \
|
||||
xfce4-pulseaudio-plugin \
|
||||
light-locker
|
||||
|
||||
RUN locale-gen en_US.UTF-8
|
||||
|
||||
RUN curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
|
||||
&& apt-get install -y ./google-chrome-stable_current_amd64.deb \
|
||||
&& rm google-chrome-stable_current_amd64.deb
|
||||
|
||||
ARG HOME=/home/coder
|
||||
ARG VNC_ROOT_DIR=/opt/vnc
|
||||
|
||||
ENV VNC_SCRIPTS=$VNC_ROOT_DIR/scripts \
|
||||
VNC_SETUP_SCRIPTS=$VNC_ROOT_DIR/setup \
|
||||
VNC_LOG_DIR=$HOME/.vnc/log \
|
||||
VNC_XSTARTUP=$VNC_ROOT_DIR/xstartup \
|
||||
VNC_SUPERVISOR_CONFIG=$VNC_ROOT_DIR/supervisord.conf \
|
||||
VNC_PORT=5990 \
|
||||
VNC_DISPLAY_ID=:90 \
|
||||
VNC_COL_DEPTH=24 \
|
||||
VNC_RESOLUTION=3840x2160 \
|
||||
NO_VNC_HOME=$VNC_ROOT_DIR/noVNC \
|
||||
NO_VNC_PORT=6081 \
|
||||
XFCE_BASE_DIR=$VNC_ROOT_DIR/xfce4 \
|
||||
XFCE_DEST_DIR=$HOME/.config/xfce4
|
||||
|
||||
WORKDIR $HOME
|
||||
|
||||
# Enable better defaults for command tab completion.
|
||||
RUN chsh -s $(readlink -f $(which zsh)) coder
|
||||
|
||||
ADD --chown=coder:coder ./xfce4 $XFCE_BASE_DIR
|
||||
ADD --chown=coder:coder ./vnc $VNC_ROOT_DIR
|
||||
ADD --chown=coder:coder ./supervisor /etc/supervisor
|
||||
|
||||
RUN find $VNC_SETUP_SCRIPTS -name '*.sh' -exec chmod a+x {} +
|
||||
|
||||
RUN $VNC_SETUP_SCRIPTS/set_user_permission.sh $VNC_ROOT_DIR \
|
||||
&& chmod +x $VNC_XSTARTUP
|
||||
|
||||
COPY ["configure", "/coder/configure"]
|
||||
RUN chmod +x /coder/configure
|
||||
|
||||
USER coder
|
||||
|
||||
RUN $VNC_SETUP_SCRIPTS/no_vnc.sh
|
||||
|
||||
EXPOSE $NO_VNC_PORT
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "Creating desktop..."
|
||||
mkdir -p "$XFCE_DEST_DIR"
|
||||
cp -rT "$XFCE_BASE_DIR" "$XFCE_DEST_DIR"
|
||||
|
||||
# Skip default shell config prompt.
|
||||
cp /etc/zsh/newuser.zshrc.recommended $HOME/.zshrc
|
||||
|
||||
echo "Initializing Supervisor..."
|
||||
nohup supervisord
|
|
@ -0,0 +1,7 @@
|
|||
[program:novnc]
|
||||
directory=%(ENV_NO_VNC_HOME)s/utils/websockify
|
||||
command=python3 -m websockify --web %(ENV_NO_VNC_HOME)s %(ENV_NO_VNC_PORT)s localhost:%(ENV_VNC_PORT)s
|
||||
autorestart=true
|
||||
stopasgroup=true
|
||||
killasgroup=true
|
||||
priority=200
|
|
@ -0,0 +1,6 @@
|
|||
[program:tigervnc]
|
||||
command=/opt/vnc/scripts/tigervnc.sh
|
||||
autorestart=true
|
||||
stopasgroup=true
|
||||
killasgroup=true
|
||||
priority=100
|
|
@ -0,0 +1,28 @@
|
|||
[unix_http_server]
|
||||
file=/tmp/supervisor.sock
|
||||
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:///tmp/supervisor.sock
|
||||
|
||||
[supervisord]
|
||||
logfile=/tmp/supervisord.log
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=5
|
||||
loglevel=info
|
||||
pidfile=/tmp/supervisord.pid
|
||||
nodaemon=false
|
||||
minfds=1024
|
||||
minprocs=200
|
||||
umask=022
|
||||
user=coder
|
||||
identifier=codervnc
|
||||
directory=/home/coder
|
||||
childlogdir=/tmp
|
||||
killasgroup=true
|
||||
stopasgroup=true
|
||||
|
||||
[include]
|
||||
files=/etc/supervisor/conf.d/*.conf
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
mkdir -p $VNC_LOG_DIR
|
||||
|
||||
if [[ -v VNC_DISPLAY_ID ]]; then
|
||||
echo "Removing previous VNC locks..."
|
||||
|
||||
vncserver -kill "$VNC_DISPLAY_ID" &> "$VNC_LOG_DIR/vnc_startup.log"
|
||||
rm -rfv /tmp/.X90-lock /tmp/.X11-unix &> "$VNC_LOG_DIR/vnc_startup.log"
|
||||
fi
|
||||
|
||||
echo -e "Starting vncserver with param: VNC_COL_DEPTH=$VNC_COL_DEPTH, VNC_RESOLUTION=$VNC_RESOLUTION\n..."
|
||||
|
||||
exec vncserver "$VNC_DISPLAY_ID" \
|
||||
-cleanstale \
|
||||
-SecurityTypes None \
|
||||
-AlwaysShared \
|
||||
-AcceptKeyEvents \
|
||||
-AcceptPointerEvents \
|
||||
-AcceptSetDesktopSize \
|
||||
-SendCutText \
|
||||
-AcceptCutText \
|
||||
-depth "$VNC_COL_DEPTH" \
|
||||
-geometry "$VNC_RESOLUTION" \
|
||||
-fg \
|
||||
-xstartup "$VNC_XSTARTUP"
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "Install noVNC - HTML5 based VNC viewer"
|
||||
mkdir -p "$NO_VNC_HOME/utils/websockify"
|
||||
wget -qO- https://github.com/novnc/noVNC/archive/v1.2.0.tar.gz | tar xz --strip 1 -C "$NO_VNC_HOME"
|
||||
wget -qO- https://github.com/novnc/websockify/archive/v0.9.0.tar.gz | tar xz --strip 1 -C "$NO_VNC_HOME/utils/websockify"
|
||||
chmod +x -v "$NO_VNC_HOME"/utils/*.sh
|
||||
|
||||
## Create index.html to forward automatically to `vnc.html`
|
||||
ln -s "$NO_VNC_HOME/vnc.html" "$NO_VNC_HOME/index.html"
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
for var in "$@"
|
||||
do
|
||||
echo "Fix permissions for: $var"
|
||||
find "$var"/ -name '*.sh' -exec chmod a+x {} +
|
||||
find "$var"/ -name '*.desktop' -exec chmod a+x {} +
|
||||
chgrp -R 0 "$var" && chmod -R a+rw "$var" && find "$var" -type d -exec chmod a+x {} +
|
||||
done
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
unset SESSION_MANAGER
|
||||
unset DBUS_SESSION_BUS_ADDRESS
|
||||
|
||||
XRESOURCES_PATH="$HOME/.Xresources"
|
||||
|
||||
if [[ ! -f $XRESOURCES_PATH ]]; then
|
||||
touch $XRESOURCES_PATH
|
||||
fi
|
||||
|
||||
xrdb $XRESOURCES_PATH
|
||||
|
||||
DISPLAY_SERVER=$(xrandr | grep -e " connected [^(]" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/")
|
||||
|
||||
# Disable screensaver and power management
|
||||
xset -dpms &
|
||||
xset s noblank &
|
||||
xset s off &
|
||||
|
||||
exec startxfce4
|
Binary file not shown.
After Width: | Height: | Size: 5.2 MiB |
|
@ -0,0 +1 @@
|
|||
WebBrowser=google-chrome
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<channel name="displays" version="1.0">
|
||||
<property name="ActiveProfile" type="string" value="Default"/>
|
||||
<property name="Default" type="empty">
|
||||
<property name="VNC-0" type="string" value="VNC-0">
|
||||
<property name="Active" type="bool" value="true"/>
|
||||
<property name="EDID" type="string" value=""/>
|
||||
<property name="Resolution" type="string" value="3840x2160"/>
|
||||
<property name="RefreshRate" type="double" value="60.000000"/>
|
||||
<property name="Rotation" type="int" value="0"/>
|
||||
<property name="Reflection" type="string" value="0"/>
|
||||
<property name="Primary" type="bool" value="false"/>
|
||||
<property name="Position" type="empty">
|
||||
<property name="X" type="int" value="0"/>
|
||||
<property name="Y" type="int" value="0"/>
|
||||
</property>
|
||||
</property>
|
||||
</property>
|
||||
<property name="Fallback" type="empty">
|
||||
<property name="VNC-0" type="string" value="VNC-0">
|
||||
<property name="Active" type="bool" value="true"/>
|
||||
<property name="EDID" type="string" value=""/>
|
||||
<property name="Resolution" type="string" value="1900x1200"/>
|
||||
<property name="RefreshRate" type="double" value="60.000000"/>
|
||||
<property name="Rotation" type="int" value="0"/>
|
||||
<property name="Reflection" type="string" value="0"/>
|
||||
<property name="Primary" type="bool" value="false"/>
|
||||
<property name="Position" type="empty">
|
||||
<property name="X" type="int" value="0"/>
|
||||
<property name="Y" type="int" value="0"/>
|
||||
</property>
|
||||
</property>
|
||||
</property>
|
||||
</channel>
|
|
@ -0,0 +1,35 @@
|
|||
<channel name="xfce4-desktop" version="1.0">
|
||||
<property name="backdrop" type="empty">
|
||||
<property name="screen0" type="empty">
|
||||
<property name="monitor0" type="empty">
|
||||
<property name="workspace0" type="empty">
|
||||
<property name="color-style" type="int" value="0"/>
|
||||
<property name="image-style" type="int" value="4"/>
|
||||
<property name="last-image" type="string" value="/home/coder/.config/xfce4/coder-bg.jpg"/>
|
||||
</property>
|
||||
<property name="workspace1" type="empty">
|
||||
<property name="color-style" type="int" value="0"/>
|
||||
<property name="image-style" type="int" value="4"/>
|
||||
<property name="last-image" type="string" value="/home/coder/.config/xfce4/coder-bg.jpg"/>
|
||||
</property>
|
||||
<property name="workspace2" type="empty">
|
||||
<property name="color-style" type="int" value="0"/>
|
||||
<property name="image-style" type="int" value="4"/>
|
||||
<property name="last-image" type="string" value="/home/coder/.config/xfce4/coder-bg.jpg"/>
|
||||
</property>
|
||||
<property name="workspace3" type="empty">
|
||||
<property name="color-style" type="int" value="0"/>
|
||||
<property name="image-style" type="int" value="4"/>
|
||||
<property name="last-image" type="string" value="/home/coder/.config/xfce4/coder-bg.jpg"/>
|
||||
</property>
|
||||
<property name="image-path" type="string" value="/home/coder/.config/xfce4/coder-bg.jpg"/>
|
||||
<property name="image-show" type="bool" value="true"/>
|
||||
<property name="image-style" type="int" value="0"/>
|
||||
</property>
|
||||
</property>
|
||||
</property>
|
||||
<property name="last" type="empty">
|
||||
<property name="window-width" type="int" value="1280"/>
|
||||
<property name="window-height" type="int" value="1024"/>
|
||||
</property>
|
||||
</channel>
|
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<channel name="xfwm4" version="1.0">
|
||||
<property name="general" type="empty">
|
||||
<property name="activate_action" type="string" value="bring"/>
|
||||
<property name="borderless_maximize" type="bool" value="true"/>
|
||||
<property name="box_move" type="bool" value="false"/>
|
||||
<property name="box_resize" type="bool" value="false"/>
|
||||
<property name="button_layout" type="string" value="O|SHMC"/>
|
||||
<property name="button_offset" type="int" value="0"/>
|
||||
<property name="button_spacing" type="int" value="0"/>
|
||||
<property name="click_to_focus" type="bool" value="true"/>
|
||||
<property name="cycle_apps_only" type="bool" value="false"/>
|
||||
<property name="cycle_draw_frame" type="bool" value="true"/>
|
||||
<property name="cycle_raise" type="bool" value="false"/>
|
||||
<property name="cycle_hidden" type="bool" value="true"/>
|
||||
<property name="cycle_minimum" type="bool" value="true"/>
|
||||
<property name="cycle_preview" type="bool" value="true"/>
|
||||
<property name="cycle_tabwin_mode" type="int" value="0"/>
|
||||
<property name="cycle_workspaces" type="bool" value="false"/>
|
||||
<property name="double_click_action" type="string" value="maximize"/>
|
||||
<property name="double_click_distance" type="int" value="5"/>
|
||||
<property name="double_click_time" type="int" value="250"/>
|
||||
<property name="easy_click" type="string" value="Alt"/>
|
||||
<property name="focus_delay" type="int" value="250"/>
|
||||
<property name="focus_hint" type="bool" value="true"/>
|
||||
<property name="focus_new" type="bool" value="true"/>
|
||||
<property name="frame_opacity" type="int" value="100"/>
|
||||
<property name="frame_border_top" type="int" value="0"/>
|
||||
<property name="full_width_title" type="bool" value="true"/>
|
||||
<property name="horiz_scroll_opacity" type="bool" value="false"/>
|
||||
<property name="inactive_opacity" type="int" value="100"/>
|
||||
<property name="maximized_offset" type="int" value="0"/>
|
||||
<property name="mousewheel_rollup" type="bool" value="true"/>
|
||||
<property name="move_opacity" type="int" value="100"/>
|
||||
<property name="placement_mode" type="string" value="center"/>
|
||||
<property name="placement_ratio" type="int" value="20"/>
|
||||
<property name="popup_opacity" type="int" value="100"/>
|
||||
<property name="prevent_focus_stealing" type="bool" value="false"/>
|
||||
<property name="raise_delay" type="int" value="250"/>
|
||||
<property name="raise_on_click" type="bool" value="true"/>
|
||||
<property name="raise_on_focus" type="bool" value="false"/>
|
||||
<property name="raise_with_any_button" type="bool" value="true"/>
|
||||
<property name="repeat_urgent_blink" type="bool" value="false"/>
|
||||
<property name="resize_opacity" type="int" value="100"/>
|
||||
<property name="scroll_workspaces" type="bool" value="true"/>
|
||||
<property name="shadow_delta_height" type="int" value="0"/>
|
||||
<property name="shadow_delta_width" type="int" value="0"/>
|
||||
<property name="shadow_delta_x" type="int" value="0"/>
|
||||
<property name="shadow_delta_y" type="int" value="-3"/>
|
||||
<property name="shadow_opacity" type="int" value="50"/>
|
||||
<property name="show_app_icon" type="bool" value="false"/>
|
||||
<property name="show_dock_shadow" type="bool" value="true"/>
|
||||
<property name="show_frame_shadow" type="bool" value="true"/>
|
||||
<property name="show_popup_shadow" type="bool" value="false"/>
|
||||
<property name="snap_resist" type="bool" value="false"/>
|
||||
<property name="snap_to_border" type="bool" value="true"/>
|
||||
<property name="snap_to_windows" type="bool" value="false"/>
|
||||
<property name="snap_width" type="int" value="10"/>
|
||||
<property name="vblank_mode" type="string" value="auto"/>
|
||||
<property name="theme" type="string" value="Default-xhdpi"/>
|
||||
<property name="tile_on_move" type="bool" value="true"/>
|
||||
<property name="title_alignment" type="string" value="center"/>
|
||||
<property name="title_font" type="string" value="Sans Bold 20"/>
|
||||
<property name="title_horizontal_offset" type="int" value="0"/>
|
||||
<property name="titleless_maximize" type="bool" value="false"/>
|
||||
<property name="title_shadow_active" type="string" value="false"/>
|
||||
<property name="title_shadow_inactive" type="string" value="false"/>
|
||||
<property name="title_vertical_offset_active" type="int" value="0"/>
|
||||
<property name="title_vertical_offset_inactive" type="int" value="0"/>
|
||||
<property name="toggle_workspaces" type="bool" value="false"/>
|
||||
<property name="unredirect_overlays" type="bool" value="true"/>
|
||||
<property name="urgent_blink" type="bool" value="false"/>
|
||||
<property name="use_compositing" type="bool" value="true"/>
|
||||
<property name="workspace_count" type="int" value="1"/>
|
||||
<property name="wrap_cycle" type="bool" value="true"/>
|
||||
<property name="wrap_layout" type="bool" value="true"/>
|
||||
<property name="wrap_resistance" type="int" value="10"/>
|
||||
<property name="wrap_windows" type="bool" value="true"/>
|
||||
<property name="wrap_workspaces" type="bool" value="false"/>
|
||||
<property name="zoom_desktop" type="bool" value="true"/>
|
||||
<property name="workspace_names" type="array">
|
||||
<value type="string" value="Workspace 1"/>
|
||||
<value type="string" value="Workspace 2"/>
|
||||
<value type="string" value="Workspace 3"/>
|
||||
<value type="string" value="Workspace 4"/>
|
||||
</property>
|
||||
</property>
|
||||
</channel>
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<channel name="xsettings" version="1.0">
|
||||
<property name="Net" type="empty">
|
||||
<property name="ThemeName" type="string" value="Greybird-dark"/>
|
||||
<property name="IconThemeName" type="string" value="elementary-xfce"/>
|
||||
<property name="DoubleClickTime" type="empty"/>
|
||||
<property name="DoubleClickDistance" type="empty"/>
|
||||
<property name="DndDragThreshold" type="empty"/>
|
||||
<property name="CursorBlink" type="empty"/>
|
||||
<property name="CursorBlinkTime" type="empty"/>
|
||||
<property name="SoundThemeName" type="empty"/>
|
||||
<property name="EnableEventSounds" type="empty"/>
|
||||
<property name="EnableInputFeedbackSounds" type="empty"/>
|
||||
</property>
|
||||
<property name="Xft" type="empty">
|
||||
<property name="DPI" type="int" value="112"/>
|
||||
<property name="Antialias" type="int" value="1"/>
|
||||
<property name="Hinting" type="int" value="1"/>
|
||||
<property name="HintStyle" type="string" value="hintmedium"/>
|
||||
<property name="RGBA" type="string" value="none"/>
|
||||
</property>
|
||||
<property name="Gtk" type="empty">
|
||||
<property name="CanChangeAccels" type="empty"/>
|
||||
<property name="ColorPalette" type="empty"/>
|
||||
<property name="FontName" type="string" value="Ubuntu 10"/>
|
||||
<property name="MonospaceFontName" type="string" value="Ubuntu Mono 10"/>
|
||||
<property name="IconSizes" type="empty"/>
|
||||
<property name="KeyThemeName" type="empty"/>
|
||||
<property name="ToolbarStyle" type="string" value="icons"/>
|
||||
<property name="ToolbarIconSize" type="empty"/>
|
||||
<property name="MenuImages" type="empty"/>
|
||||
<property name="ButtonImages" type="empty"/>
|
||||
<property name="MenuBarAccel" type="empty"/>
|
||||
<property name="CursorThemeName" type="empty"/>
|
||||
<property name="CursorThemeSize" type="empty"/>
|
||||
<property name="DecorationLayout" type="empty"/>
|
||||
</property>
|
||||
<property name="Gdk" type="empty">
|
||||
<property name="WindowScalingFactor" type="int" value="2"/>
|
||||
</property>
|
||||
<property name="Xfce" type="empty">
|
||||
<property name="LastCustomDPI" type="int" value="112"/>
|
||||
</property>
|
||||
</channel>
|
Loading…
Reference in New Issue