This commit is contained in:
岳松
2016-09-30 11:29:29 +08:00
parent 86d93d45df
commit ebb7c48688
4 changed files with 44 additions and 2 deletions

18
Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
FROM centos:latest
MAINTAINER xiaosong
RUN yum update -y \
&& yum -y install wget vim tigervnc-server epel-release firefox \
&& yum -y groupinstall xfce
RUN wget http://fpdownload.macromedia.com/get/flashplayer/pdc/11.2.202.635/install_flash_player_11_linux.x86_64.tar.gz \
&& mkdir flash_player \
&& tar zxvf install_flash_player_11_linux.x86_64.tar.gz -C flash_player \
&& mkdir -p ~/.mozilla/plugins/ \
&& cp flash_player/libflashplayer.so ~/.mozilla/plugins/ \
&& rm -rf flash_player install_flash_player_11_linux.x86_64.tar.gz /tmp/.X11-unix/*
RUN echo "xiaosong:xiaosong" | /usr/bin/vncserver
ADD ./conf/vncserver@:1.service /lib/systemd/system/vncserver@:1.service
ADD ./conf/xstartup /root/.vnc/xstartup
RUN systemctl enable vncserver@:1.service \
&& systemctl start vncserver@:1.service
EXPOSE 5901
CMD ["/bin/bash"]

View File

@@ -1,3 +1,3 @@
# vagex
# Vagex
vagex 挂机脚本 for Docker
Vagex 挂机脚本 for Docker

14
conf/vncserver@:1.service Normal file
View File

@@ -0,0 +1,14 @@
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver :1 -geometry 1280x720 -depth 24"
PIDFile=/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :'
[Install]
WantedBy=multi-user.target

10
conf/xstartup Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
startxfce4 &