centos
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,8 +1,10 @@
|
|||||||
FROM ubuntu
|
FROM centos:6
|
||||||
|
|
||||||
RUN apt-get update -y \
|
RUN yum update -y \
|
||||||
&& apt-get install -y wget firefox xfce4 vnc4server
|
&& yum -y install wget vim tigervnc-server epel-release firefox \
|
||||||
ENV DISPLAY=":1" VNC_COL_DEPTH=24 VNC_RESOLUTION=1280x800 VNC_PW=xiaosong
|
&& yum -y groupinstall xfce \
|
||||||
|
&& yum clean all
|
||||||
|
ENV VNC_PW=xiaosong
|
||||||
RUN mkdir /root/.vnc/ \
|
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 \
|
&& wget http://fpdownload.macromedia.com/get/flashplayer/pdc/11.2.202.635/install_flash_player_11_linux.x86_64.tar.gz \
|
||||||
&& mkdir flash_player \
|
&& mkdir flash_player \
|
||||||
@@ -10,9 +12,10 @@ RUN mkdir /root/.vnc/ \
|
|||||||
&& mkdir -p ~/.mozilla/plugins/ \
|
&& mkdir -p ~/.mozilla/plugins/ \
|
||||||
&& cp flash_player/libflashplayer.so ~/.mozilla/plugins/ \
|
&& cp flash_player/libflashplayer.so ~/.mozilla/plugins/ \
|
||||||
&& rm -rf flash_player install_flash_player_11_linux.x86_64.tar.gz
|
&& rm -rf flash_player install_flash_player_11_linux.x86_64.tar.gz
|
||||||
|
|
||||||
EXPOSE 5901
|
EXPOSE 5901
|
||||||
COPY xstartup /root/.vnc/
|
COPY xstartup /root/.vnc/
|
||||||
COPY vnc.sh /opt/
|
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"]
|
ENTRYPOINT ["/opt/vnc.sh"]
|
||||||
13
vnc.sh
13
vnc.sh
@@ -1,10 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
##change vnc password
|
##change vnc password
|
||||||
echo "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
|
##start vncserver
|
||||||
vncserver -kill :1 && rm -rfv /tmp/.X* ; echo "remove old vnc locks to be a reattachable container"
|
echo "remove old vnc locks to be a reattachable container"
|
||||||
vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry $VNC_RESOLUTION
|
rm -rfv /tmp/.X*
|
||||||
sleep 1
|
chkconfig vncserver on
|
||||||
|
service vncserver start && bash
|
||||||
|
|||||||
20
xstartup
20
xstartup
@@ -1,20 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# Uncomment the following two lines for normal desktop:
|
||||||
unset SESSION_MANAGER
|
unset SESSION_MANAGER
|
||||||
#unset DBUS_SESSION_BUS_ADDRESS
|
#exec /etc/X11/xinit/xinitrc
|
||||||
|
|
||||||
#startxfce4 &
|
|
||||||
#export XKL_XMODMAP_DISABLE=1
|
|
||||||
|
|
||||||
|
|
||||||
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
|
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
|
||||||
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
|
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
|
||||||
xsetroot -solid grey
|
xsetroot -solid grey
|
||||||
vncconfig -iconic &
|
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
|
||||||
|
#twm &
|
||||||
exec /etc/X11/xinit/xinitrc
|
startxfce4 &
|
||||||
#/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
|
|
||||||
Reference in New Issue
Block a user