So, for fullfilling my already 'earned' nickname 'Docker Dude' in this community I want to introduce some of you, who are interested in such kind of things, to Docker and the container image I am providing.
Here some literature:
What is Docker?
Where can you run Docker images/container?
Now for the docker-terasology project on docker-hub and how to setup a server.
The easiest approach is to use docker-compose, where you just need a docker-compose.yml configuration file and some easy commands for the console (I don't know how this is made with docker on windows, I'll just cover the Linux and Unix (MacOSX) parts).
Here a example of the docker-compose.yml (docker compose version 1!)
The only bit you have to change is where you want to store the data terasology is generating, the world, the server configuration - so you really want to have that data somewhere, where you are able to put your hands on, for configuration tinkering or just backup purposes.
If you want to stick to a specific version just change 'image: qwick/terasology:latest' to 'image: qwick/terasology:<version-tag>'.
To start the server and watch the logs on start just type docker-compose up in the directory of your docker-compose.yml, docker-compose parses your config, pulls the specified image and starts it, and also binds the direct output of the running executable to your current shell, so you see everything that happens on start. (CTRL+C to quit and also stop the currently container)
If you don't want the output, because you have already finished configuration, you can start the image with docker-compose start.
You only want to stick to the latest image? Well, a update is only made manually, so when you recognise that a new image is available, pull that image with docker-compose pull and bring your current service down with docker-compose down (which also deletes the current container, no fear! all your data still resides in the given path of your docker-compose.yml at volumes). A docker-compose create creates a new container with the same configuration and a docker-compose up or a docker-compose start will start that newly created container with your current server configuration.
Tada! Latest image working!
(Except the changes were so deep that your terasology config is outdated or the format of the world chunks has changed and the game is unable to load... ... but for that bit you should always read the project news. )
Okay, so much for the short introduction, of course you can dive deeper into docker, but that's work for yourself - I'm able to answer questions, but I won't write a deeper howto.
What's the benefit of docker?
Here some literature:
What is Docker?
Where can you run Docker images/container?
Now for the docker-terasology project on docker-hub and how to setup a server.
The easiest approach is to use docker-compose, where you just need a docker-compose.yml configuration file and some easy commands for the console (I don't know how this is made with docker on windows, I'll just cover the Linux and Unix (MacOSX) parts).
Here a example of the docker-compose.yml (docker compose version 1!)
Code:
terasology:
image: qwick/terasology:latest
ports:
- 25777:25777
volumes:
- /path/to/host/dir/where/to/store/data:/terasology/server
restart: always
If you want to stick to a specific version just change 'image: qwick/terasology:latest' to 'image: qwick/terasology:<version-tag>'.
To start the server and watch the logs on start just type docker-compose up in the directory of your docker-compose.yml, docker-compose parses your config, pulls the specified image and starts it, and also binds the direct output of the running executable to your current shell, so you see everything that happens on start. (CTRL+C to quit and also stop the currently container)
If you don't want the output, because you have already finished configuration, you can start the image with docker-compose start.
You only want to stick to the latest image? Well, a update is only made manually, so when you recognise that a new image is available, pull that image with docker-compose pull and bring your current service down with docker-compose down (which also deletes the current container, no fear! all your data still resides in the given path of your docker-compose.yml at volumes). A docker-compose create creates a new container with the same configuration and a docker-compose up or a docker-compose start will start that newly created container with your current server configuration.
Tada! Latest image working!
(Except the changes were so deep that your terasology config is outdated or the format of the world chunks has changed and the game is unable to load... ... but for that bit you should always read the project news. )
Okay, so much for the short introduction, of course you can dive deeper into docker, but that's work for yourself - I'm able to answer questions, but I won't write a deeper howto.
What's the benefit of docker?
- You do not have to install a Java 8 VM on your server, it is encapsulated inside the docker image
- Updates are as easy as pulling a new image and recreating containers
- Multiple servers on one machine? Just copy the config, change the ports and volumes and run them.
- AWS and Azure are no problem, so no need to rent a rootserver