|
1 | 1 | # noVNC Display Container |
2 | | -``` |
3 | | -``` |
4 | | -This image is intended to be used for displaying X11 applications from other containers in a browser. A stand-alone demo as well as a [Version 2](https://docs.docker.com/compose/compose-file/#version-2) composition. |
5 | 2 |
|
6 | | -## Image Contents |
| 3 | +This container image is intended to be used for displaying X11 applications from containers in a browser. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +## Container Contents |
7 | 8 |
|
8 | | -* [Xvfb](http://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml) - X11 in a virtual framebuffer |
9 | | -* [x11vnc](http://www.karlrunge.com/x11vnc/) - A VNC server that scrapes the above X11 server |
10 | | -* [noNVC](https://kanaka.github.io/noVNC/) - A HTML5 canvas vnc viewer |
11 | | -* [Fluxbox](http://www.fluxbox.org/) - a small window manager |
12 | | -* [xterm](http://invisible-island.net/xterm/) - to demo that it works |
13 | | -* [supervisord](http://supervisord.org) - to keep it all running |
| 9 | +* [Xvfb](https://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml) - X11 in a virtual framebuffer |
| 10 | +* [x11vnc](https://github.com/LibVNC/x11vnc) - A VNC server that scrapes the above X11 server |
| 11 | +* [noNVC](https://novnc.com/info.html) - A HTML5 canvas VNC viewer |
| 12 | +* [Fluxbox](https://www.fluxbox.org/) - A small window manager |
| 13 | +* [Firefox](https://www.mozilla.org/en-US/firefox/new/) - A web browser |
| 14 | +* [Chocolate Doom](https://www.chocolate-doom.org/wiki/index.php/Chocolate_Doom) - A :feelsgood: DOOM source port |
| 15 | +* [xterm](https://invisible-island.net/xterm/) - A terminal |
| 16 | +* [Mousepad](https://docs.xfce.org/apps/mousepad/start) - A text editor |
| 17 | +* [supervisord](https://supervisord.org/) - To keep it all running |
14 | 18 |
|
15 | | -## Usage |
| 19 | +## Variables |
16 | 20 |
|
17 | | -### Variables |
| 21 | +You can specify the following variables (default): |
18 | 22 |
|
19 | | -You can specify the following variables: |
20 | | -* `DISPLAY_WIDTH=<width>` (1024) |
21 | | -* `DISPLAY_HEIGHT=<height>` (768) |
22 | | -* `RUN_XTERM={yes|no}` (yes) |
23 | | -* `RUN_FLUXBOX={yes|no}` (yes) |
| 23 | +* `DISPLAY_WIDTH=<width>` (1920) |
| 24 | +* `DISPLAY_HEIGHT=<height>` (1080) |
| 25 | +* `RUN_XTERM={True|False}` (False) |
| 26 | +* `RUN_FLUXBOX={True|False}` (True) |
| 27 | +* `RUN_FIREFOX={True|False}` (False) |
| 28 | +* `RUN_DOOM={True|False}` (False) |
| 29 | + |
| 30 | +## Build the Container |
| 31 | + |
| 32 | +This command builds the Docker image from the `Dockerfile` in the current directory. |
| 33 | +The `-t novnc` option tags the image with the name `novnc`. |
24 | 34 |
|
25 | | -### Stand-alone Demo |
26 | | -Run: |
27 | 35 | ```bash |
28 | | -$ docker run --rm -it -p 8080:8080 theasp/novnc |
| 36 | +docker build -t novnc . |
29 | 37 | ``` |
30 | | -Open a browser and see the `xterm` demo at `http://<server>:8080/vnc.html` |
31 | 38 |
|
32 | | -### V2 Composition |
33 | | -A version of the [V2 docker-compose example](https://github.com/theasp/docker/blob/master/docker-compose.yml) is shown below to illustrate how this image can be used to greatly simplify the use of X11 applications in other containers. With just `docker-compose up -d`, your favorite IDE can be accessed via a browser. |
| 39 | +## Run the Container |
34 | 40 |
|
35 | | -Some notable features: |
36 | | -* An `x11` network is defined to link the IDE and novnc containers |
37 | | -* The IDE `DISPLAY` environment variable is set using the novnc container name |
38 | | -* The screen size is adjustable to suit your preferences via environment variables |
39 | | -* The only exposed port is for HTTP browser connections |
| 41 | +This command starts a container from the `novnc` image. |
40 | 42 |
|
| 43 | +```bash |
| 44 | +docker run -p 8080:8080 novnc |
41 | 45 | ``` |
42 | | -version: '2' |
43 | | -services: |
44 | | - ide: |
45 | | - image: psharkey/intellij:latest |
46 | | -# image: psharkey/netbeans-8.1:latest |
47 | | - environment: |
48 | | - - DISPLAY=novnc:0.0 |
49 | | - depends_on: |
50 | | - - novnc |
51 | | - networks: |
52 | | - - x11 |
53 | | - novnc: |
54 | | - image: theasp/novnc:latest |
55 | | - environment: |
56 | | - # Adjust to your screen size |
57 | | - - DISPLAY_WIDTH=1600 |
58 | | - - DISPLAY_HEIGHT=968 |
59 | | - - RUN_XTERM=no |
60 | | - ports: |
61 | | - - "8080:8080" |
62 | | - networks: |
63 | | - - x11 |
64 | | -networks: |
65 | | - x11: |
| 46 | + |
| 47 | +### Autostart Firefox Example |
| 48 | + |
| 49 | +This command starts a container from the `novnc` image and automatically starts Firefox. |
| 50 | + |
| 51 | +```bash |
| 52 | +docker run -p 8080:8080 -e RUN_FIREFOX=True novnc |
66 | 53 | ``` |
67 | | -**If the IDE fails to start simply run `docker-compose restart <container-name>`.** |
68 | 54 |
|
69 | | -## On DockerHub / GitHub |
70 | | -___ |
71 | | -* DockerHub [theasp/novnc](https://hub.docker.com/r/theasp/novnc/) |
72 | | -* GitHub [theasp/docker-novnc](https://github.com/theasp/docker-novnc) |
| 55 | +Open a browser and see the desktop at [`http://localhost:8080/`](http://localhost:8080/). |
| 56 | + |
| 57 | + |
| 58 | +## Thanks |
73 | 59 |
|
74 | | -# Thanks |
75 | | -___ |
76 | | -This is based on the alpine container by @psharkey: https://github.com/psharkey/docker/tree/master/novnc |
77 | | -Based on [wine-x11-novnc-docker](https://github.com/solarkennedy/wine-x11-novnc-docker) and [octave-x11-novnc-docker](https://hub.docker.com/r/epflsti/octave-x11-novnc-docker/). |
| 60 | +This container is based on the container by [@theasp](https://github.com/theasp): <https://github.com/theasp/docker-novnc> |
0 commit comments