From f65d50dae90c00867fe1290916df1001acfdb455 Mon Sep 17 00:00:00 2001 From: john Date: Fri, 9 Sep 2022 22:30:36 +0800 Subject: [PATCH] revert querk dockerfile --- Quark/Dockerfile | 73 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 11 deletions(-) diff --git a/Quark/Dockerfile b/Quark/Dockerfile index be66704..85f9a67 100644 --- a/Quark/Dockerfile +++ b/Quark/Dockerfile @@ -1,9 +1,9 @@ -FROM johnshine/crossover-vnc:latest +# Using Ubuntu 18.04 base image and VNC + +FROM ubuntu:18.04 MAINTAINER john.shine 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/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