Skip to content

Commit 80dc263

Browse files
author
dagp-ucol
committed
Dockerfile v 1.0-MC-1.19.4
1 parent b63d4dc commit 80dc263

File tree

3 files changed

+69
-4
lines changed

3 files changed

+69
-4
lines changed

Dockerfile

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
1+
# Uses the Amazon Corretto 17 image that contains the Java 17 JDK
12
FROM amazoncorretto:17
23

3-
# COPY . /games
4+
# Set the working directory to /games/minecraft-server
5+
WORKDIR /games/minecraft-server
46

5-
# WORKDIR /games/minecraft-server
7+
# Installs wget and nano to manage the server easily
8+
RUN yum install -y wget && yum install -y nano
69

7-
# CMD java -Xmx1280M -Xms1280M -jar server.jar
10+
# Download the server from Mojang Official Website
11+
RUN wget https://piston-data.mojang.com/v1/objects/8f3112a1049751cc472ec13e397eade5336ca7ae/server.jar
812

13+
# Generates the server properties and the eula to configure the server
14+
RUN java -Xmx256M -Xms256M -jar server.jar
15+
16+
# Change the server max players to 100
17+
RUN sed -i -e 's/max-players=20/max-players=100/g' server.properties
18+
19+
# Change the server name to Dockerized Minecraft
20+
RUN sed -i -e 's/motd=A Minecraft Server/motd=Dockerized Minecraft/g' server.properties
21+
22+
# Download the server icon that will be displayed in the server list
23+
RUN wget -O server-icon.png https://www.iconarchive.com/download/i106016/papirus-team/papirus-apps/minecraft.64.png
24+
25+
# Accepts the EULA, you should read it before running the server
26+
RUN echo "eula=true" > eula.txt
27+
28+
# Runs the server in the background
29+
CMD java -Xmx1024M -Xms256M -jar server.jar nogui
30+
31+
# Exposes the port 25565 to the host
32+
# Remember to use -p 25565:25565 when running
33+
# the container in order to expose the port
934
EXPOSE 25565

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,41 @@
1-
# minecraft-dockerized
1+
![server-icon.png](./img/server-icon.png "server-icon.png")
2+
# Minecraft Server Container
3+
## Introduction
4+
Hello, this is my own creation of a Minecraft server that automatically starts when executing the Docker Run command.
5+
6+
By default this server runs with the next configuration:
7+
- 1 GB of RAM.
8+
- Server MOTD: Dockerized Minecraft.
9+
- Default max players: 100.
10+
- Server Icon: https://www.iconarchive.com/download/i106016/papirus-team/papirus-apps/minecraft.64.png.
11+
- Eula already accepted (you should read it before running the server anyways).
12+
13+
And that's it, there is no modified image in this container, just simple vanilla experience.
14+
## Usage
15+
### Create a new server
16+
To start using this container you can use the basics commands of Docker.
17+
For example, to create a new server you can use the following command:
18+
1. `docker run --name minecraft-server -d -p 25565:25565 dagp/minecraft-server`
19+
2. This will start the creation of the Minecraft Server, no world is previously generated so every time you create a server there will be a different world. **Keep in mind that the command will generate the latest version of Minecraft.**
20+
21+
### Using an specific version of Minecraft
22+
In the #Tags section in this document you will find the tags to generate an specific version of Minecraft.
23+
For example if you want to create a server in 1.19.3 version you can use:
24+
25+
`docker run --name minecraft-server -d -p 25565:25565 dagp/minecraft-server:1.19.3`
26+
27+
### Starting and stoping the server
28+
`docker start minecraft-server`
29+
`docker stop minecraft-server`
30+
31+
Remember that "**minecraft-server**" can be also the container ID or a custom name that you can specify when generating the container.
32+
33+
To check the containers IDs you can use this command: `docker ps -a`
34+
35+
## Future of this project
36+
I will continue to add more versions of Minecraft and also making possible to customize RAM, max players and MOTD when generating the container. I will also try to add Bukkit/Spigot images but keep in mind that every single version need to be tested manually so it will take a while.
37+
38+
You can also find the Dockerfile if you want to generate an specific server in the following repository: https://github.com/dagp-ucol/minecraft-dockerized
39+
40+
## Tags
41+
`latest` `1.19.4`

img/server-icon.png

524 Bytes
Loading

0 commit comments

Comments
 (0)