This commit is contained in:
Your Name 2025-04-03 22:57:07 +03:00
parent 3141f78530
commit 06eabd6a27

View File

@ -1,24 +1,20 @@
FROM ubuntu:18.04 FROM ubuntu:18.04
MAINTAINER Haixin Lee <docker@lihaixin.name>
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
# RUN locale-gen en_US.UTF-8 # RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8 ENV LANG=en_US.UTF-8
ENV LANGUAGE en_US.UTF-8 ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL en_US.UTF-8 ENV LC_ALL=en_US.UTF-8
ENV XYZ 1024x768x16 ENV XYZ=1280x720x16
ENV TZ "Asia/Shanghai" ENV TZ="Asia/Shanghai"
#ENV VNC_PW "484" ENV VNC_PW="vncpass"
ENV DISPLAY :0 ENV DISPLAY=:0
#升级仓库,安装基本网络包
RUN apt-get update -y && \ RUN apt-get update -y && \
apt-get install -qqy --no-install-recommends \ apt-get install -qqy --no-install-recommends \
gettext-base wget curl iputils-ping iproute2 mtr apt-utils \ gettext-base wget curl iputils-ping iproute2 mtr apt-utils \
vim net-tools supervisor vim net-tools supervisor
# 安装基本字体
RUN apt-get -qqy --no-install-recommends install \ RUN apt-get -qqy --no-install-recommends install \
fonts-ipafont-gothic \ fonts-ipafont-gothic \
xfonts-100dpi \ xfonts-100dpi \
@ -28,42 +24,31 @@ RUN apt-get -qqy --no-install-recommends install \
language-pack-zh-hans \ language-pack-zh-hans \
ttf-wqy-microhei ttf-wqy-microhei
#升级系统安装必要的包配置VNC密码
RUN apt-get -y install xvfb x11vnc openbox xdotool git git-core ca-certificates && \ RUN apt-get -y install xvfb x11vnc openbox xdotool git git-core ca-certificates && \
mkdir ~/.vnc && \ mkdir ~/.vnc && \
touch ~/.vnc/passwd touch ~/.vnc/passwd
RUN x11vnc -storepasswd $VNC_PW ~/.vnc/passwd RUN x11vnc -storepasswd $VNC_PW ~/.vnc/passwd
# 克隆 noVNC和设置novnc首页
RUN git clone --recursive https://github.com/novnc/noVNC.git /opt/novnc && \ RUN git clone --recursive https://github.com/novnc/noVNC.git /opt/novnc && \
git clone --recursive https://github.com/novnc/websockify.git /opt/novnc/utils/websockify && \ git clone --recursive https://github.com/novnc/websockify.git /opt/novnc/utils/websockify && \
ln -s /opt/novnc/vnc.html /opt/novnc/index.html ln -s /opt/novnc/vnc.html /opt/novnc/index.html
RUN git clone --recursive https://git.n0r.su/n0rdye/novnc /opt/noweb RUN git clone --recursive https://git.n0r.su/n0rdye/novnc /opt/noweb
#安装firefox
RUN echo "deb http://archive.canonical.com/ubuntu/ xenial partner" >> /etc/apt/sources.list && \ RUN echo "deb http://archive.canonical.com/ubuntu/ xenial partner" >> /etc/apt/sources.list && \
apt-get update && \ apt-get update && \
apt-get install -y --no-install-recommends firefox && \ apt-get install -y --no-install-recommends firefox && \
locale-gen en_US.UTF-8 locale-gen en_US.UTF-8
# apt-get install -y --no-install-recommends adobe-flashplugin firefox
# 升级到最新版本 删除不必要的软件和Apt缓存包列表
RUN apt-get upgrade --yes && \ RUN apt-get upgrade --yes && \
apt-get autoclean && \ apt-get autoclean && \
apt-get autoremove && \ apt-get autoremove && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# 容器里超级进程管理和配置文件
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
#COPY myrun /usr/bin/myrun #COPY myrun /usr/bin/myrun
#RUN chmod +x /usr/bin/myrun #RUN chmod +x /usr/bin/myrun
# 开放VNC端口和noVNC端口
# EXPOSE 5900 # EXPOSE 5900
EXPOSE 8787 EXPOSE 8787
# 运行各种Service
CMD ["/usr/bin/supervisord"] CMD ["/usr/bin/supervisord"]