This commit is contained in:
岳松
2016-10-19 17:33:28 +08:00
parent ace06cb8a1
commit a6dbbfd107
3 changed files with 21 additions and 27 deletions

View File

@@ -1,8 +1,10 @@
FROM ubuntu
FROM centos:6
RUN apt-get update -y \
&& apt-get install -y wget firefox xfce4 vnc4server
ENV DISPLAY=":1" VNC_COL_DEPTH=24 VNC_RESOLUTION=1280x800 VNC_PW=xiaosong
RUN yum update -y \
&& yum -y install wget vim tigervnc-server epel-release firefox \
&& yum -y groupinstall xfce \
&& yum clean all
ENV VNC_PW=xiaosong
RUN mkdir /root/.vnc/ \
&& wget http://fpdownload.macromedia.com/get/flashplayer/pdc/11.2.202.635/install_flash_player_11_linux.x86_64.tar.gz \
&& mkdir flash_player \
@@ -10,9 +12,10 @@ RUN mkdir /root/.vnc/ \
&& mkdir -p ~/.mozilla/plugins/ \
&& cp flash_player/libflashplayer.so ~/.mozilla/plugins/ \
&& rm -rf flash_player install_flash_player_11_linux.x86_64.tar.gz
EXPOSE 5901
COPY xstartup /root/.vnc/
COPY vnc.sh /opt/
RUN chmod +x /root/.vnc/xstartup /etc/X11/xinit/xinitrc
RUN chmod +x /opt/vnc.sh /root/.vnc/xstartup /etc/X11/xinit/xinitrc \
&& echo "VNCSERVERS=\"1:root\"" >> /etc/sysconfig/vncservers \
&& echo "VNCSERVERARGS[1]=\"-geometry 1280x800 -depth 24\"" >> /etc/sysconfig/vncservers
ENTRYPOINT ["/opt/vnc.sh"]

13
vnc.sh
View File

@@ -1,10 +1,11 @@
#!/bin/bash
#!/bin/sh
##change vnc password
echo "change vnc password!"
(echo $VNC_PW && echo $VNC_PW) | vncpasswd
echo "$VNC_PW\n$VNC_PW\n\n" | vncpasswd -f > /root/.vnc/passwd
chmod 0600 /root/.vnc/passwd
##start vncserver
vncserver -kill :1 && rm -rfv /tmp/.X* ; echo "remove old vnc locks to be a reattachable container"
vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry $VNC_RESOLUTION
sleep 1
echo "remove old vnc locks to be a reattachable container"
rm -rfv /tmp/.X*
chkconfig vncserver on
service vncserver start && bash

View File

@@ -1,20 +1,10 @@
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
#unset DBUS_SESSION_BUS_ADDRESS
#startxfce4 &
#export XKL_XMODMAP_DISABLE=1
#exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
exec /etc/X11/xinit/xinitrc
#/etc/xdg/xfce4/xinitrc
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#exec /usr/bin/xfce4-session &
exec /etc/X11/xinit/xinitrc
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
startxfce4 &