Skip to content

Commit

Permalink
First upload
Browse files Browse the repository at this point in the history
First upload
  • Loading branch information
JSa1987 committed Sep 29, 2024
1 parent 52db16b commit fe2ee2b
Show file tree
Hide file tree
Showing 68 changed files with 252 additions and 1,715 deletions.
122 changes: 91 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,128 @@
# Docker Desktop [![Docker Image CI](https://github.com/piopi/cypress-desktop/actions/workflows/docker-image.yml/badge.svg)](https://github.com/piopi/cypress-desktop/actions/workflows/docker-image.yml) ![](https://img.shields.io/docker/pulls/piopirahl/docker-desktop.svg?maxAge=60480)
# JMRI Docker ![](https://img.shields.io/docker/pulls/jsa1987/jmri-docker.svg?maxAge=60480)

## Overview

A Dockerized light-weight desktop environment accessible from the browser with NoVNC. Firefox Browser included.
Containerized installation of Java Model Railroad Interface (https://www.jmri.org/). The light-weight desktop environment accessible from the browser with NoVNC is based on [piopi/docker-desktop] (https://github.com/piopi/docker-desktop).

## Usage

The image comes with noVNC to allow user to view the desktop environment running JMRI with their browsers. You will be able to access the noVNC windows at [http://localhost:6901](http://localhost:6901) or use your VNC viewer with `localhost:5901`.
JMRI WebServer and WiThrottle are enabled in the default configurations. These are accessible respectively at [http://localhost:12080](http://localhost:12080) and `hostname:12090`.

![](/screenshots/Capture.PNG)
*noVNC view of the Container running*
*noVNC view of the Container running JMRI*

The image comes with noVNC to allow user to view the desktop environment with their browsers.
## Setup

## Usage
### Basic Example

```Shell
docker run -d -p 6901:6901 -p 5901:5901 --name desktop piopirahl/docker-desktop:1.0.2
docker run -d -p 6901:6901 -p 5901:5901 -p 12080:12080 -p 12090:12090 -v home:/home/jmri --name jmri jsa1987/jmri-docker:stable
```

You will be able to access the noVNC windows at [http://localhost:6901](http://localhost:6901) or use your VNC viewer with `localhost:5901`
### Docker Compose Example
1. Docker Compose example publishing ports on the localhost and using a docker volume to store configuration files.
```
version: "3"
volumes:
home:
services:
jmri:
image: jsa1987/jmri-docker:stable
container_name: jmri
volumes:
- home:/home/jmri
environment:
- NO_VNC_PORT=6901
- VNC_COL_DEPTH=32
- VNC_RESOLUTION=1366x768
ports:
- 5901:5901
- 6901:6901
- 12080:12080
- 12090:12090
- 1234:1234 #Optional for LoconetOverTCP
- 2056:2056 #Optional for JSON server
- 4303:4303 #Optional for SRCP server
- 2048:2048 #Optional for SimpleServer
hostname: hostname.domain.com
restart: unless-stopped
```
NoVNC will be accessible at [http://localhost:6901](http://localhost:6901). JMRI WebServer will be accessible at [http://localhost:12080](http://localhost:12080) and WiThrottle will be reachable at `local_ip:12090`.

### Custom configs
2. Docker Compose example using an IPVLAN and a bind mount (local path) to store configurations files.
```
version: "3"
networks:
ipvlanname:
external: true
services:
jmri:
image: jsa1987/jmri-docker:stable
container_name: jmri
volumes:
- /local/path:/home/jmri
environment:
- NO_VNC_PORT=6901
- VNC_COL_DEPTH=32
- VNC_RESOLUTION=1366x768
hostname: hostname.domain.com
networks:
ipvlanname:
ipv4_address: xxx.xxx.xxx.xxx
dns: xxx.xxx.xxx.yyy
restart: unless-stopped
```
NoVNC will be accessible at `http://hostname.domain.com:6901` (or `http://xxx.xxx.xxx.xxx:6901`). JMRI WebServer will be accessible at `http://hostname.domain.com:12080` (or `http://xxx.xxx.xxx.xxx:6901`) and WiThrottle will be reachable at `http://hostname.domain.com:12090` (or `http://xxx.xxx.xxx.xxx:12090`).

The config files are stored under `/home/dockeruser/.config` on the container.
In order, to save on your host your configs, you can follow those steps:
### Environment variables

1. Run the docker image to generate the configs on the container
**NO_VNC_PORT** is used to set the noVNC port (default = 6901)

```Shell
docker run -d -p 6901:6901 -p 5901:5901 --name desktop piopirahl/docker-desktop:1.0.2
```
**VNC_COL_DEPTH** is used to set the VNC color depth (default = 32)

2. Copy the content of the container on the host
**VNC_RESOLUTION** is used to set the VNC resolution (default = 1366x768)

```Shell
mkdir config
docker cp desktop:/home/dockeruser/.config $PWD/config
```
### Volumes

3. Stop the running container and start a new one with a mounted volume
A docker volume or a bind mount should be used for the `/home/jmri` folder. This will allow JMRI setting, preferences etc. to be permanently saved and not to go lost when the container is re-started.

```Shell
docker rm -f desktop
docker run -d -p 6901:6901 -p 5901:5901 --name desktop -v $PWD/config/.config:/home/dockeruser/.config piopirahl/docker-desktop:1.0.2
```
### Ports

4. Now your local configs will be saved on your host machine
**6901** is the standard port exposed by default for the noVNC.

### Ports
**5901** is the port exposed by default for VNC.

**12080** is the standard port exposed by default for WebServer.

**12090** is the standard port exposed by default for WiThrottle.

**1234** is the standard port exposed by default for LoconetOverTCP.

**2056** is the standard port exposed by default for JSON server.

**4303** is the standard port exposed by default for SRCP server.

**6901** is exposed by default for the noVNC.
**2048** is the standard port exposed by default for SimpleServer.

**5901** is exposed by default for VNC.
If the port used for noVNC is changed (via Environment variable) the port to be published shall be adjusted accordingly.
If the ports chosen for JMRI WebServer, WiThrottle, LoconetOverTCP, JSON server, SRCP server and/or Simple Server are changed in the JMRI Preferences then the ports to be published shall be adjusted accordingly.

## DockerHub

DockerHub link of the images:

- [https://hub.docker.com/repository/docker/piopirahl/docker-desktop](https://hub.docker.com/repository/docker/piopirahl/docker-desktop)
- [https://hub.docker.com/r/jsa1987/jmri-docker](https://hub.docker.com/r/jsa1987/jmri-docker)

## Image Contents

- [Xvfb](http://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml) - X11 in a virtual framebuffer
- [TigerVNC](https://github.com/TigerVNC/tigervnc) - A VNC server that scrapes the above X11 server
- [noVNC](https://github.com/novnc/noVNC) - A HTML5 canvas vnc viewer
- [xfce4](https://www.xfce.org/) - a small desktop environment
- [xfce4](https://www.xfce.org/) - A small desktop environment
- [openjdk-17-jre] (https://packages.debian.org/sid/openjdk-17-jre) - Full Java runtime environment
- [JMRI] (https://www.jmri.org/) - Java Model Railroad Interface

## Maintainers

Mostapha El Sabah [Piopi](https://github.com/piopi)
[JSa1987](https://github.com/JSa1987)
64 changes: 0 additions & 64 deletions base/1.0.0/Dockerfile

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit fe2ee2b

Please sign in to comment.