-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b51bbf8
commit f65d50d
Showing
1 changed file
with
62 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
FROM johnshine/crossover-vnc:latest | ||
# Using Ubuntu 18.04 base image and VNC | ||
|
||
FROM ubuntu:18.04 | ||
MAINTAINER john.shine <[email protected]> | ||
LABEL io.openshift.expose-services="5901:tcp" | ||
|
||
ENV BOTTLE="quark" | ||
|
||
USER root | ||
|
||
ENV DISPLAY=":1" | ||
|
@@ -14,20 +14,71 @@ ENV HOME=/home/${USER} | |
ARG vnc_password="" | ||
EXPOSE 5901 6080 | ||
|
||
RUN yum check-update -y ; \ | ||
yum install -y --setopt=tsflags=nodocs libncurses.so.5 && \ | ||
yum clean all && rm -rf /var/cache/yum/* | ||
ADD xstartup ${HOME}/.vnc/ | ||
|
||
RUN useradd -g ${GID} -u ${UID} -r -d ${HOME} -s /bin/bash ${USER} | ||
RUN echo "root:root" | chpasswd | ||
# set password of ${USER} to ${USER} | ||
RUN echo "${USER}:${USER}" | chpasswd | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install -y --no-install-recommends apt-utils sudo git curl wget ca-certificates python3 python3-numpy fluxbox && \ | ||
apt-get install -y --no-install-recommends tigervnc-standalone-server tigervnc-common && \ | ||
/bin/echo -e "\n${USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ | ||
wget https://github.com/novnc/noVNC/archive/v1.1.0.tar.gz -O /tmp/noVNC.tar.gz && \ | ||
tar -zxvf /tmp/noVNC.tar.gz -C /opt && \ | ||
git clone https://github.com/novnc/websockify /opt/noVNC-1.1.0/utils/websockify && \ | ||
rm -rf /opt/noVNC-1.1.0/utils/websockify/.git /tmp/noVNC.tar.gz && \ | ||
mv /opt/noVNC-1.1.0/vnc_lite.html /opt/noVNC-1.1.0/index.html && \ | ||
sed -i 's/<title>noVNC<\/title>/<title>夸克网盘<\/title>/g' /opt/noVNC-1.1.0/index.html && \ | ||
apt-get remove -y git-man git && \ | ||
apt-get clean | ||
|
||
RUN touch ${HOME}/.vnc/passwd ${HOME}/.Xauthority /var/log/quarknetdisk.log | ||
|
||
RUN chown -R ${UID}:${GID} ${HOME} | ||
RUN chown ${UID}:${GID} /var/log/quarknetdisk.log | ||
RUN chmod 755 ${HOME}/.vnc/xstartup | ||
RUN chmod 600 ${HOME}/.vnc/passwd | ||
|
||
WORKDIR ${HOME} | ||
|
||
ADD entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
RUN apt-get install -y --no-install-recommends dbus-x11 fcitx-module-dbus fcitx-ui-classic fcitx-googlepinyin locales && \ | ||
apt-get install -y --no-install-recommends libxtst6 libgtk-3-0 libnotify4 libnss3 libxss1 libatspi2.0-0 libappindicator3-1 libsecret-1-0 libgbm1 libasound2 fonts-wqy-microhei xdg-utils desktop-file-utils && \ | ||
last_version=$(curl -s "https://pan.quark.cn/api/client_version"|grep -i -o "https:[0-9a-z/\\\.\_\-]*\.exe"|sed 's/\\//g') && \ | ||
wget ${last_version} -O /tmp/quark.exe && \ | ||
apt-get clean | ||
|
||
RUN locale-gen zh_CN.UTF-8 | ||
|
||
ENV LC_ALL "zh_CN.UTF-8" | ||
|
||
|
||
USER ${USER} | ||
WORKDIR ${HOME} | ||
|
||
ADD xstartup ${HOME}/.vnc/ | ||
RUN sudo chown ${USER}:root ${HOME}/.vnc/xstartup | ||
|
||
# Xresource settings | ||
RUN /bin/echo -e "export DISPLAY=${DISPLAY}\n[ -r ${HOME}/.Xresources ] && xrdb ${HOME}/.Xresources\nxsetroot -solid grey" >> ${HOME}/.vnc/xstartup | ||
RUN /bin/echo -e 'alias ll="ls -last"' >> ${HOME}/.bashrc | ||
|
||
RUN mkdir -p ${HOME}/.fluxbox | ||
RUN /bin/echo -e "session.screen0.toolbar.placement: TopCenter" >> ${HOME}/.fluxbox/init | ||
RUN /bin/echo -e "session.screen0.workspaces: 1 ">> ${HOME}/.fluxbox/init | ||
|
||
# Always run the WM last! | ||
RUN /bin/echo -e "export DISPLAY=${DISPLAY}" >> ${HOME}/.vnc/xstartup | ||
RUN /bin/echo -e "[ -r ${HOME}/.Xresources ] && xrdb ${HOME}/.Xresources\nfbsetroot -solid gray" >> ${HOME}/.vnc/xstartup | ||
RUN /bin/echo -e "fluxbox &" >> ${HOME}/.vnc/xstartup | ||
RUN /bin/echo -e 'export GTK_IM_MODULE=fcitx' >> ${HOME}/.vnc/xstartup | ||
RUN /bin/echo -e 'export QT_IM_MODULE=fcitx' >> ${HOME}/.vnc/xstartup | ||
RUN /bin/echo -e 'export XMODIFIERS="@im=fcitx"' >> ${HOME}/.vnc/xstartup | ||
RUN /bin/echo -e "sleep 3" >> ${HOME}/.vnc/xstartup | ||
RUN /bin/echo -e "fcitx" >> ${HOME}/.vnc/xstartup | ||
RUN /bin/echo -e "/opt/noVNC-1.1.0/utils/launch.sh --listen 6080 --vnc 127.0.0.1:5901 &" >> ${HOME}/.vnc/xstartup | ||
RUN /bin/echo -e "sudo mkdir -p /home/quark/quarknetdiskdownload/" >> ${HOME}/.vnc/xstartup | ||
RUN /bin/echo -e "sudo chmod -R a=rwx /home/quark/quarknetdiskdownload/" >> ${HOME}/.vnc/xstartup | ||
|
||
${HOME}/.vnc/xstartup | ||
RUN /bin/echo -e "tail -f /dev/null" >> ${HOME}/.vnc/xstartup |