Skip to content

Commit 3c31991

Browse files
committed
ubuntu 25.10 with firefox and doom
1 parent aebb0a3 commit 3c31991

File tree

9 files changed

+79
-113
lines changed

9 files changed

+79
-113
lines changed

.circleci/config.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**
2+
!entrypoint.sh
3+
!supervisord.conf
4+
!conf.d/*

README.md

Lines changed: 44 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,60 @@
11
# 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.
52

6-
## Image Contents
3+
This container image is intended to be used for displaying X11 applications from containers in a browser.
4+
5+
![Screenshot: macOS Safari with Firefox in a container](./img/screenshot.png)
6+
7+
## Container Contents
78

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
1418

15-
## Usage
19+
## Variables
1620

17-
### Variables
21+
You can specify the following variables (default):
1822

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`.
2434

25-
### Stand-alone Demo
26-
Run:
2735
```bash
28-
$ docker run --rm -it -p 8080:8080 theasp/novnc
36+
docker build -t novnc .
2937
```
30-
Open a browser and see the `xterm` demo at `http://<server>:8080/vnc.html`
3138

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
3440

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.
4042

43+
```bash
44+
docker run -p 8080:8080 novnc
4145
```
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
6653
```
67-
**If the IDE fails to start simply run `docker-compose restart <container-name>`.**
6854

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
7359

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>

conf.d/doom.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[program:doom]
2+
command=/usr/games/doom
3+
autorestart=true

conf.d/firefox.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[program:firefox]
2+
command=/usr/bin/firefox
3+
autorestart=true

conf.d/fluxbox-menu

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[begin] (Fluxbox)
2+
[exec] (Terminal) {xterm}
3+
[exec] (Text Editor) {mousepad}
4+
[exec] (Firefox) {/usr/bin/firefox}
5+
[exec] (DOOM) {/usr/games/doom}
6+
[end]

docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
version: '2'
22
services:
33
ide:
4-
image: psharkey/intellij:latest
5-
# image: psharkey/netbeans-8.1:latest
4+
image: docker.io/psharkey/intellij:latest
65
environment:
76
- DISPLAY=novnc:0.0
87
depends_on:
98
- novnc
109
networks:
1110
- x11
12-
novnc:
13-
image: theasp/novnc:latest
11+
novnc:
12+
build:
13+
context: .
1414
environment:
1515
# Adjust to your screen size
16-
- DISPLAY_WIDTH=1600
17-
- DISPLAY_HEIGHT=968
16+
- DISPLAY_WIDTH=1280
17+
- DISPLAY_HEIGHT=720
1818
ports:
1919
- "8080:8080"
2020
networks:

entrypoint.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
#!/bin/bash
22
set -ex
33

4-
RUN_FLUXBOX=${RUN_FLUXBOX:-yes}
5-
RUN_XTERM=${RUN_XTERM:-yes}
4+
if [ "${RUN_FLUXBOX,,}" != "true" ]; then
5+
rm -f /app/conf.d/fluxbox.conf
6+
fi
67

7-
case $RUN_FLUXBOX in
8-
false|no|n|0)
9-
rm -f /app/conf.d/fluxbox.conf
10-
;;
11-
esac
8+
if [ "${RUN_XTERM,,}" != "true" ]; then
9+
rm -f /app/conf.d/xterm.conf
10+
fi
1211

13-
case $RUN_XTERM in
14-
false|no|n|0)
15-
rm -f /app/conf.d/xterm.conf
16-
;;
17-
esac
12+
if [ "${RUN_FIREFOX,,}" != "true" ]; then
13+
rm -f /app/conf.d/firefox.conf
14+
fi
15+
16+
if [ "${RUN_DOOM,,}" != "true" ]; then
17+
rm -f /app/conf.d/doom.conf
18+
fi
1819

1920
exec supervisord -c /app/supervisord.conf

img/screenshot.png

372 KB
Loading

0 commit comments

Comments
 (0)