first commit
This commit is contained in:
49
Dockerfile
Normal file
49
Dockerfile
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
#https://github.com/uphy/novnc-alpine-docker
|
||||||
|
RUN \
|
||||||
|
apk --update --upgrade add \
|
||||||
|
bash \
|
||||||
|
fluxbox \
|
||||||
|
git \
|
||||||
|
supervisor \
|
||||||
|
xvfb \
|
||||||
|
x11vnc \
|
||||||
|
&& \
|
||||||
|
# Install noVNC
|
||||||
|
git clone --depth 1 https://github.com/novnc/noVNC.git /opt/noVNC && \
|
||||||
|
git clone --depth 1 https://github.com/novnc/websockify /opt/noVNC/utils/websockify && \
|
||||||
|
rm -rf /opt/noVNC/.git && \
|
||||||
|
rm -rf /opt/noVNC/utils/websockify/.git && \
|
||||||
|
apk del git && \
|
||||||
|
sed -i -- "s/ps -p/ps -o pid | grep/g" /opt/noVNC/utils/launch.sh
|
||||||
|
|
||||||
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
# Setup environment variables
|
||||||
|
ENV HOME=/root \
|
||||||
|
DEBIAN_FRONTEND=noninteractive \
|
||||||
|
LANG=en_US.UTF-8 \
|
||||||
|
LANGUAGE=en_US.UTF-8 \
|
||||||
|
LC_ALL=C.UTF-8 \
|
||||||
|
DISPLAY=:0.0 \
|
||||||
|
DISPLAY_WIDTH=1280 \
|
||||||
|
DISPLAY_HEIGHT=680
|
||||||
|
|
||||||
|
#AJOUT BMT pour lancher xterm
|
||||||
|
RUN \
|
||||||
|
# Install xterm
|
||||||
|
apk add xterm && \
|
||||||
|
apk add firefox-esr dbus ttf-freefont && \
|
||||||
|
# Append xterm entry to supervisord.conf
|
||||||
|
cd /etc/supervisor/conf.d && \
|
||||||
|
echo '[program:xterm]' >> supervisord.conf && \
|
||||||
|
echo 'command=xterm' >> supervisord.conf && \
|
||||||
|
echo 'autorestart=true' >> supervisord.conf
|
||||||
|
|
||||||
|
#AJOUT BEN pour alias index>vnc.html
|
||||||
|
RUN \
|
||||||
|
cd /opt/noVNC && \
|
||||||
|
ln -s vnc.html index.html
|
||||||
|
|
||||||
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||||
43
README.md
Normal file
43
README.md
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# Dockerfile for noVNC
|
||||||
|
|
||||||
|
This repository provides the base image of noVNC.
|
||||||
|
|
||||||
|
# Run (Simple)
|
||||||
|
|
||||||
|
You can run this image as follows.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ docker run -it --rm -p 8080:8080 uphy/novnc-alpine
|
||||||
|
```
|
||||||
|
|
||||||
|
Please extend this image and install the GUI apps you want,
|
||||||
|
because there's no applications installed in this image.
|
||||||
|
|
||||||
|
# Run (With your apps)
|
||||||
|
|
||||||
|
For example, you can run 'xterm' on the docker container and provide the app in the browser as follows.
|
||||||
|
|
||||||
|
Create your Dockerfile like below.
|
||||||
|
|
||||||
|
```Dockerfile
|
||||||
|
FROM uphy/novnc-alpine
|
||||||
|
RUN \
|
||||||
|
# Install xterm
|
||||||
|
apk add xterm && \
|
||||||
|
# Append xterm entry to supervisord.conf
|
||||||
|
cd /etc/supervisor/conf.d && \
|
||||||
|
echo '[program:xterm]' >> supervisord.conf && \
|
||||||
|
echo 'command=xterm' >> supervisord.conf && \
|
||||||
|
echo 'autorestart=true' >> supervisord.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
Build and run the image.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ docker build -t mynovnc .
|
||||||
|
$ docker run -it --rm -p 8080:8080 mynovnc
|
||||||
|
```
|
||||||
|
|
||||||
|
Open the browser http://localhost:8080.
|
||||||
|
Click 'Connect'.
|
||||||
|
Then you can see xterm.
|
||||||
49
makefile
Normal file
49
makefile
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
#########################################
|
||||||
|
#VARIABLES: CAN BE EDITED
|
||||||
|
#########################################
|
||||||
|
|
||||||
|
CONTAINER=novnc
|
||||||
|
|
||||||
|
CONTNAME=$(CONTAINER)-1
|
||||||
|
|
||||||
|
DATAVOL=/home/docker/$(CONTAINER)/vol
|
||||||
|
|
||||||
|
|
||||||
|
#net=host: mandatory for others containers to connect to mysql
|
||||||
|
STARTOPT=-d \
|
||||||
|
-p 8091:8080 \
|
||||||
|
-v $(DATAVOL):/root \
|
||||||
|
--name $(CONTNAME) \
|
||||||
|
$(CONTAINER)
|
||||||
|
|
||||||
|
|
||||||
|
#########################################
|
||||||
|
# ACTIONS: DO NOT EDIT BEYOND THIS POINT
|
||||||
|
#########################################
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t $(CONTAINER) .
|
||||||
|
|
||||||
|
run:
|
||||||
|
docker run $(STARTOPT)
|
||||||
|
|
||||||
|
bash:
|
||||||
|
docker exec -i -t $(CONTNAME) /bin/bash
|
||||||
|
|
||||||
|
stop:
|
||||||
|
docker stop $(CONTNAME)
|
||||||
|
|
||||||
|
delete:
|
||||||
|
docker rm $(CONTNAME)
|
||||||
|
|
||||||
|
clear:
|
||||||
|
docker rmi -f $(CONTAINER)
|
||||||
|
|
||||||
|
install:
|
||||||
|
docker run --restart=always $(STARTOPT)
|
||||||
|
|
||||||
|
cleanupdb:
|
||||||
|
make stop;make delete
|
||||||
|
|
||||||
|
restart:
|
||||||
|
make stop;make delete ;make build ;make run
|
||||||
23
supervisord.conf
Normal file
23
supervisord.conf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
|
||||||
|
[program:X11]
|
||||||
|
command=Xvfb :0 -screen 0 "%(ENV_DISPLAY_WIDTH)s"x"%(ENV_DISPLAY_HEIGHT)s"x24
|
||||||
|
autorestart=true
|
||||||
|
|
||||||
|
[program:x11vnc]
|
||||||
|
command=/usr/bin/x11vnc
|
||||||
|
autorestart=true
|
||||||
|
|
||||||
|
[program:novnc]
|
||||||
|
command=/opt/noVNC/utils/launch.sh --vnc localhost:5900 --listen 8080
|
||||||
|
autorestart=true
|
||||||
|
|
||||||
|
#[program:novnc]
|
||||||
|
#command=/opt/noVNC/utils/launch.sh --vnc benux.mailliet.ovh:5901 --listen 8081
|
||||||
|
#autorestart=true
|
||||||
|
|
||||||
|
[program:fluxbox]
|
||||||
|
command=fluxbox
|
||||||
|
autorestart=true
|
||||||
|
|
||||||
Reference in New Issue
Block a user