first commit
This commit is contained in:
commit
12b9558c6a
66
Dockerfile
Normal file
66
Dockerfile
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
FROM ubuntu:16.04
|
||||||
|
MAINTAINER Haixin Lee <docker@lihaixin.name>
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
RUN locale-gen en_US.UTF-8
|
||||||
|
ENV LANG en_US.UTF-8
|
||||||
|
ENV LANGUAGE en_US.UTF-8
|
||||||
|
ENV LC_ALL en_US.UTF-8
|
||||||
|
|
||||||
|
ENV XYZ 1024x768x16
|
||||||
|
ENV TZ "Asia/Shanghai"
|
||||||
|
ENV VNC_PW "vncpassword"
|
||||||
|
ENV DISPLAY :0
|
||||||
|
|
||||||
|
|
||||||
|
#升级仓库,安装基本网络包
|
||||||
|
RUN apt-get update -y && \
|
||||||
|
apt-get install -qqy --no-install-recommends \
|
||||||
|
gettext-base wget curl iputils-ping iproute2 mtr apt-utils \
|
||||||
|
vim net-tools supervisor
|
||||||
|
|
||||||
|
# 安装基本字体
|
||||||
|
RUN apt-get -qqy --no-install-recommends install \
|
||||||
|
fonts-ipafont-gothic \
|
||||||
|
xfonts-100dpi \
|
||||||
|
xfonts-75dpi \
|
||||||
|
xfonts-cyrillic \
|
||||||
|
xfonts-scalable \
|
||||||
|
language-pack-zh-hans \
|
||||||
|
ttf-wqy-microhei
|
||||||
|
|
||||||
|
#升级系统,安装必要的包,配置VNC密码
|
||||||
|
RUN apt-get -y install xvfb x11vnc fluxbox xdotool git git-core ca-certificates && \
|
||||||
|
mkdir ~/.vnc && \
|
||||||
|
touch ~/.vnc/passwd
|
||||||
|
RUN x11vnc -storepasswd $VNC_PW ~/.vnc/passwd
|
||||||
|
|
||||||
|
# 克隆 noVNC和设置novnc首页
|
||||||
|
RUN git clone --recursive https://github.com/kanaka/noVNC.git /opt/novnc && \
|
||||||
|
git clone --recursive https://github.com/kanaka/websockify.git /opt/novnc/utils/websockify && \
|
||||||
|
ln -s /opt/novnc/vnc.html /opt/novnc/index.html
|
||||||
|
|
||||||
|
#安装firefox
|
||||||
|
RUN echo "deb http://archive.canonical.com/ubuntu/ xenial partner" >> /etc/apt/sources.list && \
|
||||||
|
apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends adobe-flashplugin firefox
|
||||||
|
|
||||||
|
|
||||||
|
# 升级到最新版本 删除不必要的软件和Apt缓存包列表
|
||||||
|
RUN apt-get upgrade --yes && \
|
||||||
|
apt-get autoclean && \
|
||||||
|
apt-get autoremove && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# 容器里超级进程管理和配置文件
|
||||||
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
COPY myrun /usr/bin/myrun
|
||||||
|
RUN chmod +x /usr/bin/myrun
|
||||||
|
|
||||||
|
# 开放VNC端口和noVNC端口
|
||||||
|
# EXPOSE 5900
|
||||||
|
EXPOSE 8787
|
||||||
|
|
||||||
|
|
||||||
|
# 运行各种Service
|
||||||
|
|
||||||
|
CMD ["/usr/bin/supervisord"]
|
21
README.md
Normal file
21
README.md
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
## firefox介绍
|
||||||
|
|
||||||
|
基于ubuntu:16.04 配置x11和novnc 服务和中文字体,在容器里运行firefox 游览器,已经配置支付flash播放
|
||||||
|
|
||||||
|
## 用法
|
||||||
|
|
||||||
|
###运行容器
|
||||||
|
|
||||||
|
docker run -d -p 5900:5900 -p 8787:8787 --name chromium lihaixin/chromium
|
||||||
|
|
||||||
|
###修改VNC密码
|
||||||
|
|
||||||
|
docker exec -it chromium /bin/sh -c "x11vnc -storepasswd VNCPASSWORD ~/.vnc/passwd"
|
||||||
|
|
||||||
|
|
||||||
|
###如何访问
|
||||||
|
|
||||||
|
firefox http://<IP>:8787
|
||||||
|
|
||||||
|
vncviewer <IP>:5900
|
||||||
|
|
5
myrun
Normal file
5
myrun
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
echo $TZ > /etc/timezone
|
||||||
|
cp -f /usr/share/zoneinfo/$TZ /etc/localtime
|
||||||
|
x11vnc -storepasswd $VNC_PW ~/.vnc/passwd
|
||||||
|
|
62
supervisord.conf
Normal file
62
supervisord.conf
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
|
||||||
|
[program:X11]
|
||||||
|
priority=10
|
||||||
|
directory=/
|
||||||
|
command=/usr/bin/Xvfb :0 -screen 0 %(ENV_XYZ)s
|
||||||
|
user=root
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
stopsignal=QUIT
|
||||||
|
stdout_logfile=/var/log/xvfb.log
|
||||||
|
redirect_stderr=true
|
||||||
|
|
||||||
|
[program:x11vnc]
|
||||||
|
priority=20
|
||||||
|
directory=/
|
||||||
|
command=x11vnc -display :0 -shared -usepw
|
||||||
|
user=root
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
stopsignal=QUIT
|
||||||
|
stdout_logfile=/var/log/x11vnc.log
|
||||||
|
redirect_stderr=true
|
||||||
|
|
||||||
|
|
||||||
|
[program:fluxbox]
|
||||||
|
priority=20
|
||||||
|
directory=/
|
||||||
|
command=/usr/bin/startfluxbox
|
||||||
|
user=root
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
stopsignal=QUIT
|
||||||
|
stdout_logfile=/var/log/fluxbox.log
|
||||||
|
redirect_stderr=true
|
||||||
|
stopasgroup=true
|
||||||
|
|
||||||
|
[program:novnc]
|
||||||
|
priority=25
|
||||||
|
directory=/opt/novnc
|
||||||
|
command=/opt/novnc/utils/launch.sh --vnc localhost:5900 --listen 8787 --web /opt/novnc
|
||||||
|
user=root
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
stopsignal=QUIT
|
||||||
|
stdout_logfile=/var/log/novnc.log
|
||||||
|
redirect_stderr=true
|
||||||
|
stopasgroup=true
|
||||||
|
|
||||||
|
[program:myrun]
|
||||||
|
priority=27
|
||||||
|
command=/usr/bin/myrun
|
||||||
|
autorestart=false
|
||||||
|
stdout_logfile=/var/log/myrun.log
|
||||||
|
|
||||||
|
|
||||||
|
[program:firefox]
|
||||||
|
priority=30
|
||||||
|
command=/usr/bin/firefox https://www.alexamaster.net/autosurf.php?Master=20698
|
||||||
|
autorestart=true
|
||||||
|
stdout_logfile=/var/log/firefox.log
|
Loading…
Reference in New Issue
Block a user