diff --git a/DOCKERHUB.md b/DOCKERHUB.md index e4b7acc..735c68c 100644 --- a/DOCKERHUB.md +++ b/DOCKERHUB.md @@ -1,13 +1,13 @@ -# Docker container for BTDEX -[![Docker Image Size](https://img.shields.io/docker/image-size/furritos/docker-btdex/latest)](https://hub.docker.com/r/furritos/docker-btdex/tags) +# Docker container for SMAPP +[![Docker Image Size](https://img.shields.io/docker/image-size/furritos/docker-smapp/latest)](https://hub.docker.com/r/furritos/docker-smapp/tags) -This project takes the standalone **BTDEX** application and transforms into portable, web-accessible +This project takes the standalone **Spacemesh + Wallet** application and transforms into portable, web-accessible container using Docker and noVNC. --- -[![BTDEX logo](doc/img/btdex-docker.png)](https://btdex.trade/) -**BTDEX** is a decentralized exchange (DEX) system running on the [Signum](https://signum.network/) blockchain. +[![SMAPP logo](doc/img/smapp-docker.png)](https://spacemesh.io/) +**Spacemesh App** is desktop application for Windows 10, OS X and Linux, now in a Docker container, which includes a Smesher and a basic wallet. --- @@ -18,46 +18,177 @@ should be adjusted as needed. First, clone this repository: ``` -git clone https://github.com/furritos/docker-btdex.git -cd docker-btdex +git clone https://github.com/furritos/docker-smapp.git +cd docker-smapp ``` -Launch the **BTDEX** Docker container with the following, Linux and PowerShell compatible, command: +Launch the **SMAPP** Docker container with the following, Linux and PowerShell compatible, command: ``` docker run -d \ - --name=container-btdex \ - -v ${pwd}/config:/opt/btdex/.config \ - -v ${pwd}/plots:/opt/btdex/plots \ - -v ${pwd}/cache:/opt/btdex/cache \ + --name=container-smapp \ + -v ${pwd}/config:/root/.config/Spacemesh \ + -v ${pwd}/post:/root/post \ -p 5800:8080 \ - -p 5900:5900 \ - furritos/docker-btdex + furritos/docker-smapp ``` Finally, take your favorite web browse and open `http://localhost:5800`. -Please refer to this [Get Started](https://btdex.trade/index.html#GetStarted) page for more information on using **BTDEX**. +Please refer to this [Get Started](https://spacemesh.io/start/) page for more information on using **SMAPP**. **NOTE:** By default, the resolution is set to `1440X900`. To override these values, set resolution to `1680X1050`, the `docker run` command line would be: ``` docker run -d \ - --name=container-btdex \ - -v ${pwd}/config:/opt/btdex/.config \ - -v ${pwd}/plots:/opt/btdex/plots \ - -v ${pwd}/cache:/opt/btdex/cache \ + --name=container-smapp \ + -v ${pwd}/config:/root/.config/Spacemesh \ + -v ${pwd}/post:/root/post \ -p 5800:8080 \ - -p 5900:5900 \ -e DISPLAY_WIDTH=1680 \ -e DISPLAY_HEIGHT=1050 \ - furritos/docker-btdex + furritos/docker-smapp ``` -## Documentation +## Docker Basic Usage -Full documentation is available at https://github.com/furritos/docker-btdex. +``` +docker run [-d] \ + --name=container-smapp \ + [-v :[:PERMISSIONS]]... \ + [-p :]... \ + [-e =]... \ + furritos/docker-smapp +``` +| Parameter | Description | +|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------| +| -d | Run the container in the background. If not set, the container runs in the foreground. | +| -v | Set a volume mapping (allows to share a folder/file between the host and the container). See the [Data Volumes](#data-volumes) section for more details. | +| -p | Set a network port mapping (exposes an internal container port to the host). See the [Ports](#ports) section for more details. | +| -e | Pass an environment variable to the container. See the [Environment Variables](#environment-variables) section for more details. | + +### Environment Variables + +To customize some properties of this container, the following environment variables can be passed via the `-e` parameter (one for each variable). Value of this parameter has the format `=`. + +| Variable | Description | Default | +|----------------|-------------------------------------------------|---------| +|`DISPLAY_WIDTH` | Width (in pixels) of the application's window. | `1440` | +|`DISPLAY_HEIGHT`| Height (in pixels) of the application's window. | `900` | + +### Data Volumes + +The following table describes data volumes used by the container. The mappings +are set via the `-v` parameter. Each mapping is specified with the following +format: `:[:PERMISSIONS]`. + +| Container path | Permissions | Description | +|-------------------------|-------------|-----------------------------------------| +|`/root/.config/Spacemesh`| rw | SMAPP configuration artifacts directory | +|`/root/post` | rw | Plot files to be used for mining | + +### Ports + +Here is the list of ports used by the container. They can be mapped to the host +via the `-p` parameter (one per port mapping). Each mapping is defined in the +following format: `:`. The port number inside the +container cannot be changed, but you are free to use any port on the host side. + +| Host Port | Container Port | Mapping to host | Description | +|-------------|----------------|-----------------|-----------------------------------------------------------------------------------------------------| +| 5800 | 8080 | Mandatory | Port used to access the application's GUI via the web interface. | +| 5900 | 5900 | Optional | Port used to access the application's GUI via the VNC protocol. Optional if no VNC client is used. | + +### Changing Parameters of a Running Container + +As can be seen, environment variables, volume and port mappings are all specified +while creating the container. + +The following steps describe the method used to add, remove or update +parameter(s) of an existing container. The general idea is to destroy and +re-create the container: + + 1. Stop the container (if it is running): +``` +docker stop container-smapp +``` + 2. Remove the container: +``` +docker rm container-smapp +``` + 3. Create/start the container using the `docker run` command, by adjusting + parameters as needed. + +**NOTE**: Since all application's data is saved under the `${pwd}/config` folder in +the host volume, destroying and re-creating a container is not a problem: nothing is lost +and the application comes back with the same state (as long as the volume mapping of +the `${pwd}/config` to `/root/.config/Spacemesh` folder remains the same). The same is +also true for the `/root/post` directory. + +## Docker Image Update + +Because features are added, issues are fixed, or simply because a new version +of the containerized application is integrated, the Docker image is regularly +updated. Different methods can be used to update the Docker image. + +The system used to run the container may have a built-in way to update +containers. If so, this could be your primary way to update Docker images. + +An other way is to have the image be automatically updated with [Watchtower]. +Whatchtower is a container-based solution for automating Docker image updates. +This is a "set and forget" type of solution: once a new image is available, +Watchtower will seamlessly perform the necessary steps to update the container. + +Finally, the Docker image can be manually updated with these steps: + + 1. Fetch the latest image: +``` +docker pull furritos/docker-smapp +``` + 2. Stop the container: +``` +docker stop container-smapp +``` + 3. Remove the container: +``` +docker rm container-smapp +``` + 4. Create and start the container using the `docker run` command, with the +the same parameters that were used when it was deployed initially. + +[Watchtower]: https://github.com/containrrr/watchtower + +### unRAID + +For unRAID, a container image can be updated by following these steps: + + 1. Select the *Docker* tab. + 2. Click the *Check for Updates* button at the bottom of the page. + 3. Click the *update ready* link of the container to be updated. + +## Accessing the GUI + +Assuming that container's ports are mapped to the same host's ports, the +graphical interface of the application can be accessed via: + + * A web browser: +``` +http://:5800 +``` + + * Any VNC client (must expose port first): +``` +:5900 +``` + +## Shell Access + +To get shell access to the running container, execute the following command: + +``` +docker exec -ti container-smapp sh +``` ## Support or Contact Having troubles with the container or have questions? Please [create a new issue]. -[create a new issue]: https://github.com/furritos/docker-btdex/issues \ No newline at end of file +[create a new issue]: https://github.com/furritos/docker-smapp/issues \ No newline at end of file diff --git a/README.md b/README.md index 6c4b122..735c68c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# Docker container for BTDEX -[![Docker Image Size](https://img.shields.io/docker/image-size/furritos/docker-btdex/latest)](https://hub.docker.com/r/furritos/docker-btdex/tags) +# Docker container for SMAPP +[![Docker Image Size](https://img.shields.io/docker/image-size/furritos/docker-smapp/latest)](https://hub.docker.com/r/furritos/docker-smapp/tags) -This project takes the standalone **BTDEX** application and transforms into portable, web-accessible +This project takes the standalone **Spacemesh + Wallet** application and transforms into portable, web-accessible container using Docker and noVNC. --- -[![BTDEX logo](doc/img/btdex-docker.png)](https://btdex.trade/) -**BTDEX** is a decentralized exchange (DEX) system running on the [Signum](https://signum.network/) blockchain. +[![SMAPP logo](doc/img/smapp-docker.png)](https://spacemesh.io/) +**Spacemesh App** is desktop application for Windows 10, OS X and Linux, now in a Docker container, which includes a Smesher and a basic wallet. --- @@ -18,84 +18,60 @@ should be adjusted as needed. First, clone this repository: ``` -git clone https://github.com/furritos/docker-btdex.git -cd docker-btdex +git clone https://github.com/furritos/docker-smapp.git +cd docker-smapp ``` -Launch the **BTDEX** Docker container with the following, Linux and PowerShell compatible, command: +Launch the **SMAPP** Docker container with the following, Linux and PowerShell compatible, command: ``` docker run -d \ - --name=container-btdex \ - -v ${pwd}/config:/opt/btdex/.config \ - -v ${pwd}/plots:/opt/btdex/plots \ - -v ${pwd}/cache:/opt/btdex/cache \ + --name=container-smapp \ + -v ${pwd}/config:/root/.config/Spacemesh \ + -v ${pwd}/post:/root/post \ -p 5800:8080 \ - -p 5900:5900 \ - furritos/docker-btdex + furritos/docker-smapp ``` Finally, take your favorite web browse and open `http://localhost:5800`. -Please refer to this [Get Started](https://btdex.trade/index.html#GetStarted) page for more information on using **BTDEX**. +Please refer to this [Get Started](https://spacemesh.io/start/) page for more information on using **SMAPP**. **NOTE:** By default, the resolution is set to `1440X900`. To override these values, set resolution to `1680X1050`, the `docker run` command line would be: ``` docker run -d \ - --name=container-btdex \ - -v ${pwd}/config:/opt/btdex/.config \ - -v ${pwd}/plots:/opt/btdex/plots \ - -v ${pwd}/cache:/opt/btdex/cache \ + --name=container-smapp \ + -v ${pwd}/config:/root/.config/Spacemesh \ + -v ${pwd}/post:/root/post \ -p 5800:8080 \ - -p 5900:5900 \ -e DISPLAY_WIDTH=1680 \ -e DISPLAY_HEIGHT=1050 \ - furritos/docker-btdex + furritos/docker-smapp ``` -### Cache Volume Configuration - -**Required if plotting will be performed** - - - Click on the **MINING** tab **(1)** and then click on **Select a SSD cache** button **(2)** - ![cache-1](doc/img/cache-1.png) - - Select the `cache` folder and click `Open` - ![cache2](doc/img/cache-2.png) - -### Plots Volume Configuration - -**Required if mining will be performed** - - - Click on the **MINING** tab **(1)** and then click on **Select a disk folder to use** button **(2)** - ![cache-1](doc/img/plot-1.png) - - Select the `plots` folder and click `Open` - ![cache2](doc/img/plot-2.png) - ---- - ## Docker Basic Usage ``` docker run [-d] \ - --name=container-btdex \ + --name=container-smapp \ [-v :[:PERMISSIONS]]... \ [-p :]... \ [-e =]... \ - furritos/docker-btdex + furritos/docker-smapp ``` -| Parameter | Description | -|-----------|-------------| -| -d | Run the container in the background. If not set, the container runs in the foreground. | +| Parameter | Description | +|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------| +| -d | Run the container in the background. If not set, the container runs in the foreground. | | -v | Set a volume mapping (allows to share a folder/file between the host and the container). See the [Data Volumes](#data-volumes) section for more details. | -| -p | Set a network port mapping (exposes an internal container port to the host). See the [Ports](#ports) section for more details. | -| -e | Pass an environment variable to the container. See the [Environment Variables](#environment-variables) section for more details. | +| -p | Set a network port mapping (exposes an internal container port to the host). See the [Ports](#ports) section for more details. | +| -e | Pass an environment variable to the container. See the [Environment Variables](#environment-variables) section for more details. | ### Environment Variables To customize some properties of this container, the following environment variables can be passed via the `-e` parameter (one for each variable). Value of this parameter has the format `=`. -| Variable | Description | Default | -|----------------|----------------------------------------------|---------| -|`DISPLAY_WIDTH`| Width (in pixels) of the application's window. | `1440` | -|`DISPLAY_HEIGHT`| Height (in pixels) of the application's window. | `900` | +| Variable | Description | Default | +|----------------|-------------------------------------------------|---------| +|`DISPLAY_WIDTH` | Width (in pixels) of the application's window. | `1440` | +|`DISPLAY_HEIGHT`| Height (in pixels) of the application's window. | `900` | ### Data Volumes @@ -103,11 +79,10 @@ The following table describes data volumes used by the container. The mappings are set via the `-v` parameter. Each mapping is specified with the following format: `:[:PERMISSIONS]`. -| Container path | Permissions | Description | -|-----------------|-------------|-------------| -|`/opt/btdex/.config`| rw | BTDEX configuration artifacts directory | -|`/opt/btdex/cache`| rw | Presumably, high-speed storage to aid in plot file creation | -|`/opt/btdex/plots`| rw | Plot files to be used for mining | +| Container path | Permissions | Description | +|-------------------------|-------------|-----------------------------------------| +|`/root/.config/Spacemesh`| rw | SMAPP configuration artifacts directory | +|`/root/post` | rw | Plot files to be used for mining | ### Ports @@ -116,11 +91,10 @@ via the `-p` parameter (one per port mapping). Each mapping is defined in the following format: `:`. The port number inside the container cannot be changed, but you are free to use any port on the host side. -| Host Port | Container Port | Mapping to host | Description | -|-----------|----------------|-----------------|-------------| -| 5800 | 8080 | Mandatory | Port used to access the application's GUI via the web interface. | -| 5900 | 5900 | Optional | Port used to access the application's GUI via the VNC protocol. Optional if no VNC client is used. | -| 9000 | 9000 | Optional | Port used by *BTDEX* to expose API endpoints. More information can be found over at [BTDEX - API](https://github.com/btdex/btdex#api) section. | +| Host Port | Container Port | Mapping to host | Description | +|-------------|----------------|-----------------|-----------------------------------------------------------------------------------------------------| +| 5800 | 8080 | Mandatory | Port used to access the application's GUI via the web interface. | +| 5900 | 5900 | Optional | Port used to access the application's GUI via the VNC protocol. Optional if no VNC client is used. | ### Changing Parameters of a Running Container @@ -133,19 +107,20 @@ re-create the container: 1. Stop the container (if it is running): ``` -docker stop container-btdex +docker stop container-smapp ``` 2. Remove the container: ``` -docker rm container-btdex +docker rm container-smapp ``` 3. Create/start the container using the `docker run` command, by adjusting parameters as needed. -**NOTE**: Since all application's data is saved under the `/opt/btdex/.config` container -folder, destroying and re-creating a container is not a problem: nothing is lost +**NOTE**: Since all application's data is saved under the `${pwd}/config` folder in +the host volume, destroying and re-creating a container is not a problem: nothing is lost and the application comes back with the same state (as long as the volume mapping of -the `/opt/btdex/.config` folder remains the same). +the `${pwd}/config` to `/root/.config/Spacemesh` folder remains the same). The same is +also true for the `/root/post` directory. ## Docker Image Update @@ -165,15 +140,15 @@ Finally, the Docker image can be manually updated with these steps: 1. Fetch the latest image: ``` -docker pull furritos/docker-btdex +docker pull furritos/docker-smapp ``` 2. Stop the container: ``` -docker stop container-btdex +docker stop container-smapp ``` 3. Remove the container: ``` -docker rm container-btdex +docker rm container-smapp ``` 4. Create and start the container using the `docker run` command, with the the same parameters that were used when it was deployed initially. @@ -208,7 +183,7 @@ http://:5800 To get shell access to the running container, execute the following command: ``` -docker exec -ti container-btdex sh +docker exec -ti container-smapp sh ``` ## Support or Contact @@ -216,4 +191,4 @@ docker exec -ti container-btdex sh Having troubles with the container or have questions? Please [create a new issue]. -[create a new issue]: https://github.com/furritos/docker-btdex/issues \ No newline at end of file +[create a new issue]: https://github.com/furritos/docker-smapp/issues \ No newline at end of file diff --git a/doc/img/btdex-docker.png b/doc/img/btdex-docker.png deleted file mode 100644 index 8adf6c4..0000000 Binary files a/doc/img/btdex-docker.png and /dev/null differ diff --git a/doc/img/cache-1.png b/doc/img/cache-1.png deleted file mode 100644 index 71085e1..0000000 Binary files a/doc/img/cache-1.png and /dev/null differ diff --git a/doc/img/cache-2.png b/doc/img/cache-2.png deleted file mode 100644 index 6d253fe..0000000 Binary files a/doc/img/cache-2.png and /dev/null differ diff --git a/doc/img/plot-1.png b/doc/img/plot-1.png deleted file mode 100644 index de6b6e6..0000000 Binary files a/doc/img/plot-1.png and /dev/null differ diff --git a/doc/img/plot-2.png b/doc/img/plot-2.png deleted file mode 100644 index 2ddabc9..0000000 Binary files a/doc/img/plot-2.png and /dev/null differ diff --git a/doc/img/smapp-docker.png b/doc/img/smapp-docker.png new file mode 100644 index 0000000..d6d565f Binary files /dev/null and b/doc/img/smapp-docker.png differ