Skip to content

Commit 7fc1c03

Browse files
committed
adding a README and some updates
1 parent a8d55fc commit 7fc1c03

File tree

10 files changed

+328
-5
lines changed

10 files changed

+328
-5
lines changed
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
{
2+
"credit": "Made with Blockbench",
3+
"texture_size": [64, 64],
4+
"textures": {
5+
"0": "linky",
6+
"particle": "linky"
7+
},
8+
"elements": [
9+
{
10+
"from": [4, 0, 4],
11+
"to": [12, 1, 12],
12+
"rotation": {"angle": 0, "axis": "x", "origin": [8, 4, 8]},
13+
"faces": {
14+
"north": {"uv": [0, 6.5, 2, 6.75], "texture": "#0"},
15+
"east": {"uv": [6.5, 0.25, 8.5, 0.5], "texture": "#0"},
16+
"south": {"uv": [6.5, 0.5, 8.5, 0.75], "texture": "#0"},
17+
"west": {"uv": [6.5, 0.75, 8.5, 1], "texture": "#0"},
18+
"up": {"uv": [4.5, 2, 2.5, 0], "texture": "#0"},
19+
"down": {"uv": [4.5, 2, 2.5, 4], "texture": "#0"}
20+
}
21+
},
22+
{
23+
"from": [3, 1, 3],
24+
"to": [13, 2, 13],
25+
"rotation": {"angle": 0, "axis": "y", "origin": [3, 1, 3]},
26+
"faces": {
27+
"north": {"uv": [6, 4.25, 8.5, 4.5], "texture": "#0"},
28+
"east": {"uv": [6, 4.5, 8.5, 4.75], "texture": "#0"},
29+
"south": {"uv": [6, 4.75, 8.5, 5], "texture": "#0"},
30+
"west": {"uv": [6.5, 0, 9, 0.25], "texture": "#0"},
31+
"up": {"uv": [2.5, 2.5, 0, 0], "texture": "#0"},
32+
"down": {"uv": [2.5, 2.5, 0, 5], "texture": "#0"}
33+
}
34+
},
35+
{
36+
"from": [4, 2, 4],
37+
"to": [12, 5, 12],
38+
"rotation": {"angle": 0, "axis": "y", "origin": [4, 2, 4]},
39+
"faces": {
40+
"north": {"uv": [0, 5, 2, 5.75], "texture": "#0"},
41+
"east": {"uv": [4.5, 5, 6.5, 5.75], "texture": "#0"},
42+
"south": {"uv": [0, 5.75, 2, 6.5], "texture": "#0"},
43+
"west": {"uv": [4.5, 5.75, 6.5, 6.5], "texture": "#0"},
44+
"up": {"uv": [4.5, 6, 2.5, 4], "texture": "#0"},
45+
"down": {"uv": [6.5, 0, 4.5, 2], "texture": "#0"}
46+
}
47+
},
48+
{
49+
"from": [5, 4, 5],
50+
"to": [11, 7, 11],
51+
"rotation": {"angle": 0, "axis": "y", "origin": [5, 4, 5]},
52+
"faces": {
53+
"north": {"uv": [2, 6, 3.5, 6.75], "texture": "#0"},
54+
"east": {"uv": [6, 2, 7.5, 2.75], "texture": "#0"},
55+
"south": {"uv": [6, 2.75, 7.5, 3.5], "texture": "#0"},
56+
"west": {"uv": [6, 3.5, 7.5, 4.25], "texture": "#0"},
57+
"up": {"uv": [6, 3.5, 4.5, 2], "texture": "#0"},
58+
"down": {"uv": [6, 3.5, 4.5, 5], "texture": "#0"}
59+
}
60+
},
61+
{
62+
"from": [5, 2, 3],
63+
"to": [7, 4, 6],
64+
"rotation": {"angle": 0, "axis": "y", "origin": [5, 2, 3]},
65+
"faces": {
66+
"north": {"uv": [7.25, 1.5, 7.75, 2], "texture": "#0"},
67+
"east": {"uv": [6.5, 1.5, 7.25, 2], "texture": "#0"},
68+
"south": {"uv": [2.75, 7.25, 3.25, 7.75], "texture": "#0"},
69+
"west": {"uv": [4, 6.5, 4.75, 7], "texture": "#0"},
70+
"up": {"uv": [5.25, 7.25, 4.75, 6.5], "texture": "#0"},
71+
"down": {"uv": [7, 5, 6.5, 5.75], "texture": "#0"}
72+
}
73+
},
74+
{
75+
"from": [8, 2, 3],
76+
"to": [10, 4, 6],
77+
"rotation": {"angle": 0, "axis": "y", "origin": [8, 2, 3]},
78+
"faces": {
79+
"north": {"uv": [0, 7.25, 0.5, 7.75], "texture": "#0"},
80+
"east": {"uv": [3.5, 6, 4.25, 6.5], "texture": "#0"},
81+
"south": {"uv": [7.25, 1, 7.75, 1.5], "texture": "#0"},
82+
"west": {"uv": [6.5, 1, 7.25, 1.5], "texture": "#0"},
83+
"up": {"uv": [2.5, 5.75, 2, 5], "texture": "#0"},
84+
"down": {"uv": [4, 6.5, 3.5, 7.25], "texture": "#0"}
85+
}
86+
},
87+
{
88+
"from": [12, 0, 4],
89+
"to": [15, 1, 6],
90+
"rotation": {"angle": 0, "axis": "y", "origin": [12, 0, 4]},
91+
"faces": {
92+
"north": {"uv": [3.25, 7.25, 4, 7.5], "texture": "#0"},
93+
"east": {"uv": [2, 5.75, 2.5, 6], "texture": "#0"},
94+
"south": {"uv": [7.25, 5.75, 8, 6], "texture": "#0"},
95+
"west": {"uv": [4.75, 7.25, 5.25, 7.5], "texture": "#0"},
96+
"up": {"uv": [6, 7, 5.25, 6.5], "texture": "#0"},
97+
"down": {"uv": [7.25, 5.75, 6.5, 6.25], "texture": "#0"}
98+
}
99+
},
100+
{
101+
"from": [1, 0, 4],
102+
"to": [4, 1, 6],
103+
"rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 4]},
104+
"faces": {
105+
"north": {"uv": [7.5, 2.25, 8.25, 2.5], "texture": "#0"},
106+
"east": {"uv": [7.5, 6.25, 8, 6.5], "texture": "#0"},
107+
"south": {"uv": [7.5, 2.5, 8.25, 2.75], "texture": "#0"},
108+
"west": {"uv": [7.5, 6.5, 8, 6.75], "texture": "#0"},
109+
"up": {"uv": [3.5, 7.25, 2.75, 6.75], "texture": "#0"},
110+
"down": {"uv": [7.5, 6.25, 6.75, 6.75], "texture": "#0"}
111+
}
112+
},
113+
{
114+
"from": [1, 0, 9],
115+
"to": [4, 1, 11],
116+
"rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 9]},
117+
"faces": {
118+
"north": {"uv": [7.5, 2.75, 8.25, 3], "texture": "#0"},
119+
"east": {"uv": [6.75, 7.5, 7.25, 7.75], "texture": "#0"},
120+
"south": {"uv": [7.5, 3, 8.25, 3.25], "texture": "#0"},
121+
"west": {"uv": [7.5, 6.75, 8, 7], "texture": "#0"},
122+
"up": {"uv": [7.5, 7.25, 6.75, 6.75], "texture": "#0"},
123+
"down": {"uv": [4.75, 7, 4, 7.5], "texture": "#0"}
124+
}
125+
},
126+
{
127+
"from": [10, 0, 1],
128+
"to": [12, 1, 4],
129+
"rotation": {"angle": 0, "axis": "y", "origin": [10, 0, 4]},
130+
"faces": {
131+
"north": {"uv": [4.5, 7.5, 5, 7.75], "texture": "#0"},
132+
"east": {"uv": [0.5, 7.5, 1.25, 7.75], "texture": "#0"},
133+
"south": {"uv": [7.5, 5, 8, 5.25], "texture": "#0"},
134+
"west": {"uv": [1.25, 7.5, 2, 7.75], "texture": "#0"},
135+
"up": {"uv": [1.25, 7.5, 0.75, 6.75], "texture": "#0"},
136+
"down": {"uv": [1.75, 6.75, 1.25, 7.5], "texture": "#0"}
137+
}
138+
},
139+
{
140+
"from": [10, 0, 12],
141+
"to": [12, 1, 15],
142+
"rotation": {"angle": 0, "axis": "y", "origin": [10, 0, 15]},
143+
"faces": {
144+
"north": {"uv": [7.5, 7.25, 8, 7.5], "texture": "#0"},
145+
"east": {"uv": [7.5, 3.5, 8.25, 3.75], "texture": "#0"},
146+
"south": {"uv": [0, 7.75, 0.5, 8], "texture": "#0"},
147+
"west": {"uv": [7.5, 3.75, 8.25, 4], "texture": "#0"},
148+
"up": {"uv": [6.25, 7.75, 5.75, 7], "texture": "#0"},
149+
"down": {"uv": [6.75, 7, 6.25, 7.75], "texture": "#0"}
150+
}
151+
},
152+
{
153+
"from": [4, 0, 1],
154+
"to": [6, 1, 4],
155+
"rotation": {"angle": 0, "axis": "y", "origin": [4, 0, 4]},
156+
"faces": {
157+
"north": {"uv": [7.5, 5.25, 8, 5.5], "texture": "#0"},
158+
"east": {"uv": [2, 7.5, 2.75, 7.75], "texture": "#0"},
159+
"south": {"uv": [7.5, 5.5, 8, 5.75], "texture": "#0"},
160+
"west": {"uv": [7.5, 2, 8.25, 2.25], "texture": "#0"},
161+
"up": {"uv": [2.25, 7.5, 1.75, 6.75], "texture": "#0"},
162+
"down": {"uv": [2.75, 6.75, 2.25, 7.5], "texture": "#0"}
163+
}
164+
},
165+
{
166+
"from": [4, 0, 12],
167+
"to": [6, 1, 15],
168+
"rotation": {"angle": 0, "axis": "y", "origin": [4, 0, 15]},
169+
"faces": {
170+
"north": {"uv": [7.5, 7, 8, 7.25], "texture": "#0"},
171+
"east": {"uv": [3.25, 7.5, 4, 7.75], "texture": "#0"},
172+
"south": {"uv": [7.25, 7.5, 7.75, 7.75], "texture": "#0"},
173+
"west": {"uv": [7.5, 3.25, 8.25, 3.5], "texture": "#0"},
174+
"up": {"uv": [7.5, 5.75, 7, 5], "texture": "#0"},
175+
"down": {"uv": [5.75, 7, 5.25, 7.75], "texture": "#0"}
176+
}
177+
},
178+
{
179+
"from": [12, 0, 9],
180+
"to": [15, 1, 11],
181+
"rotation": {"angle": 0, "axis": "y", "origin": [12, 0, 9]},
182+
"faces": {
183+
"north": {"uv": [7.25, 6, 8, 6.25], "texture": "#0"},
184+
"east": {"uv": [4, 7.5, 4.5, 7.75], "texture": "#0"},
185+
"south": {"uv": [6.75, 7.25, 7.5, 7.5], "texture": "#0"},
186+
"west": {"uv": [7.5, 4, 8, 4.25], "texture": "#0"},
187+
"up": {"uv": [6.75, 7, 6, 6.5], "texture": "#0"},
188+
"down": {"uv": [0.75, 6.75, 0, 7.25], "texture": "#0"}
189+
}
190+
}
191+
],
192+
"display": {
193+
"thirdperson_lefthand": {
194+
"rotation": [95, 0, 0],
195+
"translation": [-1.75, 0, 0]
196+
},
197+
"head": {
198+
"translation": [0, 18.75, 0],
199+
"scale": [1.56, 1.56, 1.56]
200+
}
201+
}
202+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"parent": "item/generated",
3+
"textures": {
4+
"layer0": "item/carved_pumpkin"
5+
},
6+
7+
"overrides": [
8+
{"predicate": {"custom_model_data":1}, "model": "block/custom/linky"}
9+
]
10+
}
1.08 KB
Loading
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"pack": {
3+
"pack_format": 18,
4+
"description": "GuardCraft Resource Pack"
5+
}
6+
}

README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# GuardCraft - Guarded Containerized Minecraft Server
2+
3+
GuardCraft is a containerized Minecraft (Java) server that is designed to be secure and easy to use. It is built on top of the [Java JRE Chainguard Image](https://images.chainguard.dev/directory/image/jre/versions).
4+
5+
## Features
6+
The GuardCraft server is designed to be secure and easy to use. It includes the following features:
7+
- Minimal container image with low-to-zero CVEs
8+
- Easy configuration with environment variables
9+
- Easy setup with Docker Compose
10+
11+
Currently, Guardcraft is available only for Minecraft Java version.
12+
13+
*This setup was validated on an Ubuntu 24.04 system.*
14+
15+
### GuardCraft Resource Pack
16+
This is a WIP feature that will be available *SOON*.
17+
18+
## Usage
19+
To build the image, run:
20+
21+
```shell
22+
docker build -t guardcraft-java .
23+
```
24+
25+
Use the following command to run the image in your local environment:
26+
27+
```shell
28+
docker compose up
29+
```
30+
You should be able to see output with relevant information about the server setup:
31+
32+
```shell
33+
[+] Running 1/1
34+
✔ Container guardcraft-server-java-server-1 Recreated 0.1s
35+
Attaching to java-server-1
36+
java-server-1 | Setting difficulty=easy
37+
java-server-1 | Setting gamemode=survival
38+
java-server-1 | Setting level-name=GuardCraft
39+
java-server-1 | Setting level-seed=-1718501946501227358
40+
java-server-1 | Setting motd=Welcome to GuardCraft!
41+
java-server-1 | Starting net.minecraft.server.Main
42+
java-server-1 | [18:11:14] [ServerMain/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD]
43+
java-server-1 | [18:11:14] [ServerMain/INFO]: No existing world data, creating new world
44+
java-server-1 | [18:11:15] [ServerMain/INFO]: Loaded 1370 recipes
45+
java-server-1 | [18:11:15] [ServerMain/INFO]: Loaded 1481 advancements
46+
java-server-1 | [18:11:15] [Server thread/INFO]: Starting minecraft server version 1.21.4
47+
java-server-1 | [18:11:15] [Server thread/INFO]: Loading properties
48+
java-server-1 | [18:11:15] [Server thread/INFO]: Default game type: SURVIVAL
49+
java-server-1 | [18:11:15] [Server thread/INFO]: Generating keypair
50+
java-server-1 | [18:11:15] [Server thread/INFO]: Starting Minecraft server on *:25565
51+
...
52+
```
53+
54+
Once the server is up and running, you can connect to it using a Minecraft Java client **on the same local network**.
55+
56+
To connect to the server, you'll need to add a new server using the host machine's local IP address and port `25565` (the default port). You can also use the `localhost` address if you're running the server on the same machine as the client.
57+
58+
> Find your local IP address on Linux systems: `ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p'`
59+
60+
![Connect to Server](./assets/connect-java.png)
61+
When connecting, you should see details about your user on the server logs:
62+
63+
```shell
64+
java-server-1 | [18:12:21] [Server thread/INFO]: Server empty for 60 seconds, pausing
65+
java-server-1 | [18:14:29] [User Authenticator #1/INFO]: UUID of player boredcatmom is xxxxx-xxxx-xxxx-xxxx-xxxxxxxx
66+
java-server-1 | [18:14:30] [Server thread/INFO]: boredcatmom[/192.168.178.167:37192] logged in with entity id 78 at (20.5, 66.0, 4.5)
67+
java-server-1 | [18:14:30] [Server thread/INFO]: boredcatmom joined the game
68+
69+
````
70+
71+
## Configuration
72+
The GuardCraft server can be configured using dynamic environment variables that get replaced in the `server.properties` file. Any properties can be configured with the following format: `MC_<property_name>`. Hyphens (`-`) should be replaced with underscores (`_`). For example, to set the `server-port` property, use the `MC_server_port` environment variable.
73+
74+
Included `docker-compose.yaml` file:
75+
76+
```yaml
77+
services:
78+
java-server:
79+
image: guardcraft-java
80+
restart: unless-stopped
81+
ports:
82+
- 25565:25565
83+
environment:
84+
# Server properties Set Up
85+
# MC_* variables will be replaced in the server.properties file
86+
# Hyphens should be replaced with underscores
87+
MC_gamemode: "survival"
88+
MC_difficulty: "easy"
89+
MC_motd: "Welcome to GuardCraft!"
90+
MC_level_name: "GuardCraft"
91+
MC_level_seed: "-1718501946501227358"
92+
```
93+
94+
This will set up a server in **Survival** mode, with **Easy** difficulty, and a **Welcome to GuardCraft!** message of the day. The server will be named **GuardCraft** and will use the specified seed to generate the world. You should spawn in an area with a village nearby.
95+
96+
![Spawn Area](./assets/spawn.png)
97+
98+
Have fun with 0 CVEs!

assets/connect-java.png

2.76 MB
Loading

assets/spawn.png

2.55 MB
Loading

build-config.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ if [ "${#mcEnvs[@]}" -gt 0 ]; then
1313
for mcConfig in "${mcEnvs[@]}"; do
1414
IFS='_' read -ra CONFIG <<< "${mcConfig}"
1515
key=${CONFIG[1]}
16-
if [ -n "${CONFIG[2]}" ]; then
17-
key="${CONFIG[1]}-${CONFIG[2]}"
16+
if [ "${#CONFIG[@]}" -gt 2 ]; then
17+
for ((i=2; i<${#CONFIG[@]}; i++)); do
18+
key="${key}-${CONFIG[i]}"
19+
done
1820
fi
1921
value=${!mcConfig}
2022
echo "Setting $key=$value"
21-
#sed -i "s/^$key=.*/$key=$value/" $SERVER_PATH/server.properties
23+
sed -i "s~^$key=.*~$key=${value}~" $SERVER_PATH/server.properties
2224
done
2325
fi
2426

docker-compose.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ services:
55
ports:
66
- 25565:25565
77
environment:
8+
# Server properties Set Up
9+
# MC_* variables will be replaced in the server.properties file
10+
# Hyphens should be replaced with underscores
811
MC_gamemode: "survival"
912
MC_difficulty: "easy"
1013
MC_motd: "Welcome to GuardCraft!"
11-
#hyphens should be replaced with underscores
1214
MC_level_name: "GuardCraft"
13-
MC_level_seed: "-1718501946501227358"
15+
MC_level_seed: "-1718501946501227358"
16+
# Custom Resource pack is a WIP, will update when it's ready
17+
# MC_resource_pack: "https://github.com/chainguard-dev/guardcraft-server/raw/refs/heads/main/GuardCraft_Resource_Pack.zip"
18+
# MC_require_resource_pack: "true"

0 commit comments

Comments
 (0)