3 minutes to build a minecraft server with Docker _docker

Source: Internet
Author: User

1 written in front of the words

As a veteran gamer, I refused when I first contacted Minecraft (My world), but after playing for a while I couldn't stop. Minecraft (hereinafter referred to as MC) as a sandbox game, with a very high degree of freedom, what you want to play depends entirely on you. You can carry on the traditional wilderness to survive, play strange upgrade, you can build a variety of styles of architecture, can become the red stone tatsu people, to achieve a variety of automation and so on. This is the most typical "other people's game", there is a great God in the game built a 32-bit computer you can believe it? Other people's world, oh no, is my world first introduced here.

To get to the end, some time ago with NetEase honeycomb container built a minecraft original survival clothing, the performance of the leverage. Play it up that's called a 6. Think of the vast number of small partners or play a single machine, can not be happy with a good base friends to play, or play with others open a variety of restrictions on the clothing, all kinds of unpleasant. So specially finishing a tutorial, the benefit of the vast number of mcers.

2 How to Build

As we all know, MC is written in Java, both client and server are directly a jar package, so the prerequisite is to have a JRE. My MC suit is completely manually set up, first with you simple to talk about the steps of manual construction.

1, create a Linux container, Ubuntu, Debian, CentOS see what you like, I use Debian

2. Install JRE or JDK

3, the installation of basic tools, Tmux, vim and so on

4, download the minecraft server file

5. Use Tmux to run Minecraft server files

6, the basic server configuration

Why do you use Tmux here? Because we are playing the game, we have to do some operations on the premise of Non-stop service, such as adding Op,ban off an IP, and so on, and then let it continue to run in the background. Tmux just meet this demand, of course, other tools can also, but I used to use tmux just.

can see manual operation or more troublesome, that there is a simpler way? The answer is yes, NetEase Honeycomb is based on Docker container cloud platform, using Docker characteristics, we can make the MC server image by Dockerfile, and then use the mirror to create a container on it, gossip not much, directly on the dockerfile.

Docker,minecraft Server

Introduce the dockerfile, because the honeycomb is officially mirrored by the JDK, so use it directly as a base image and then install some basic tools. The 2nd part is to create a directory to use as a working directory and download the server files to that directory. The 3rd part is to create and set up the requirements of the MC server files, the following specific. Part 4 represents the portal at the start of the container, using Tmux to allow the server to run in the background while SSH logon is enabled. When you start the server, you do not specify the parameters of the JVM because you are unsure of the specifications that you use when you create the container.

In the 2nd step, I uploaded the server file to the Oschina git library for demonstration purposes. Of course, here you can replace the server file you want to download the address, if the local already have downloaded good files, you can upload directly to the container.

Here is a look at the file the MC server needs, in fact, the names of these documents clearly tell you their role.

The first file is Eula.txt, the literal meaning of the End User License Agreement, and you must agree to the agreement (set in the file Eula=true) to start the server normally. When you do not create the file, the server automatically creates the Eula.txt the first time it is run, and tells you that you must agree to the agreement before it can be started.

Another important file is server.properties, which holds the various configuration of the server-related parameters. The meaning of the specific parameters, you can go directly to the wiki view. Here only a login-related parameter online-mode=true, this parameter indicates whether to open online verification, what meaning, when the start online verification, for each login account, the server will go to Minecraft's account system to verify that the account is legitimate, if not legitimate will be refused to log in. If you want to turn off online authentication when the server is started, you can add run echo online-mode=false > in part 3rd Server.properties can, but when the close online verification, then any login account will not verify, direct login, that is, you just know someone else's username, you can directly login to someone else's account, so we suggest that you open online verification.

Other files, such as IP blacklist banned-ips.json, account blacklist banned-players.json, op list Ops.json, etc., here is not detailed, interested students can go to the wiki look, the file structure is very simple.

3 to open the MC tour

Using Dockerfile to build a custom mirror and create a container with a built mirror is not done here, you can refer to the Honeycomb official Help document https://c.163.com/wiki/index.php?title= create a custom mirror and https://c.163.com/wiki/index.php?title= Create a container.

When the container is created, open the Minecraft client, enter the newly created container extranet IP, and start your Minecraft trip.

Friendship Tip: As we all know, Minecraft is very eating memory, so it is recommended that you use more than 1G of memory specifications.

4 PostScript

This tutorial simply teaches you to create a MC server in the simplest way, and of course it makes creating and starting processes more elegant and customizable. For example, a fully customizable server.properties can be generated by using the DOCKERFILE environment variable env coordination script. About the MC server How to configure the knowledge, there are opportunities to share with you later. Hope to help everyone, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.