Add Dockerfile (#1504)

* feat: Add Dockerfile
* fix: Download latest version and not a fixed one

Using jq we can query the appvoyor api to get the latest jobId
This commit is contained in:
Tan to the Dashi 2021-03-14 11:14:13 +01:00 committed by GitHub
parent 90505dbc4c
commit fd7a84bc91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 0 deletions

10
Docker/Dockerfile Normal file
View file

@ -0,0 +1,10 @@
FROM mono:6.12.0
COPY start-latest.sh /opt/start-latest.sh
RUN apt-get update && \
apt-get install -y jq && \
mkdir /opt/data && \
chmod +x /opt/start-latest.sh
ENTRYPOINT ["/bin/sh", "-c", "/opt/start-latest.sh"]

12
Docker/start-latest.sh Normal file
View file

@ -0,0 +1,12 @@
#!/bin/sh
cd /opt/data || exit 1
# Get latest Job ID
JOB_ID=$(curl -L https://ci.appveyor.com/api/projects/ORelio/minecraft-console-client | jq -r .build.jobs[0].jobId)
# Download latest version
curl -L https://ci.appveyor.com/api/buildjobs/"$JOB_ID"/artifacts/MinecraftClient%2Fbin%2FRelease%2FMinecraftClient.exe --output MinecraftClient.exe
# Start Client
mono MinecraftClient.exe

View file

@ -19,6 +19,25 @@ Then, open a terminal in this folder and run "mono MinecraftClient.exe".
If you cannot authenticate on Mono, you'll need to run "mozroots --import --ask-remove" once. If you cannot authenticate on Mono, you'll need to run "mozroots --import --ask-remove" once.
If Mono crashes, retry with mono-complete instead of mono-runtime. Use at least Mono v4.0. If Mono crashes, retry with mono-complete instead of mono-runtime. Use at least Mono v4.0.
Using Docker do the following:
```bash
# Using HTTPS
git clone https://github.com/ORelio/Minecraft-Console-Client.git
# Using SSH
git clone git@github.com:ORelio/Minecraft-Console-Client.git
cd Minecraft-Console-Client/Docker
docker build -t minecraft-console-client:latest .
# 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_MASCHINE_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.
Using Configuration files & Enabling bots Using Configuration files & Enabling bots
------ ------