Added docker-compose configuration (#1855)

* Fixed some spelling and typing mistakes

* Added docker-compose configuration

* Added docker-compose description to the user manual

* changed the default path of the mapped volume to a relative path
This commit is contained in:
Archer57 2021-12-19 03:49:02 +00:00 committed by GitHub
parent 5a56ae65b2
commit 2858e0cbb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 2 deletions

View file

@ -0,0 +1,9 @@
version: '2'
services:
MCC:
image: 'minecraft-console-client:latest'
container_name: 'MinecraftConsoleClient'
# You could also comment out the volumes section if you don't want to mount the volume. That is up to you. If you do so it's harder to edit the .ini file if thats something you want to do.
volumes:
- './data:/opt/data'

View file

@ -19,7 +19,12 @@ Then, open a terminal in this folder and run "mono MinecraftClient.exe".
If you cannot authenticate on Mono because you have TLS/HTTPS/Certificate errors, you'll need to run `mozroots --import --ask-remove` once or install `ca-certificates-mono` (See [#1708](https://github.com/MCCTeam/Minecraft-Console-Client/issues/1708#issuecomment-893768862)).
If Mono crashes, retry with `mono-complete` instead of `mono-runtime`. Use at least Mono v4.0.
Docker
------
Using Docker do the following:
**Building the Image:**
```bash
# Using HTTPS
git clone https://github.com/MCCTeam/Minecraft-Console-Client.git
@ -30,14 +35,45 @@ git clone git@github.com:MCCTeam/Minecraft-Console-Client.git
cd Minecraft-Console-Client/Docker
docker build -t minecraft-console-client:latest .
```
**Start the container using Docker:**
```bash
# You could also ignore the -v parameter if you dont want to mount the volume that is up to you. If you don't it's harder to edit the .ini file if thats something you want to do
docker run -it -v <PATH_ON_YOUR_MACHINE_TO_MOUNT>:/opt/data minecraft-console-client:latest
```
Now you could login and the Client is running. To detach from the Client but still keep it running in the Background press: `CTRL + P`, `CTRL + Q`.
To reattach use the `docker attach` command.
**Start the container using docker-compose:**
By default, the volume of the container gets mapped into a new folder named `data` in the same folder the `docker-compose.yml` is stored.
If you don't want to map a volume, you have to comment out or delete the entire volumes section:
```yml
#volumes:
#- './data:/opt/data'
```
Make sure you are in the directory the `docker-compose.yml` is stored before you attempt to start. If you do so, you can start the container:
```bash
docker-compose run MCC
```
Remember to remove the container after usage:
```bash
docker-compose down
```
If you use the INI file and entered your data (username, password, server) there, you can start your container using
```bash
docker-compose up
docker-compose up -d #for deamonized running in the background
```
Note that you won't be able to interact with the client using `docker-compose up`. If you want that functionality, please use the first method: `docker-compose run MCC`.
As above, you can stop and remove the container using
```bash
docker-compose down
```
Using Configuration files & Enabling bots
------