docs: update docs of README.mds.

summary: update command docker compose to docker-compose.
This commit is contained in:
Mark
2023-01-05 22:29:01 +08:00
parent 20e3e4c434
commit 4b0c67e2aa
40 changed files with 518 additions and 332 deletions

View File

@@ -1,7 +1,9 @@
## Minecraft server
This example defines a basic setup for a Minecraft server. More details on the Minecraft server docker image can be found [here](https://github.com/itzg/docker-minecraft-server/blob/master/README.md).
Project structure:
```
.
├── compose.yaml
@@ -9,6 +11,7 @@ Project structure:
```
[_compose.yaml_](compose.yaml)
```
services:
minecraft:
@@ -28,13 +31,13 @@ This example maps the Minecraft data folder holding all game storage to ~/minecr
```
$ mkdir -p ~/minecraft_data
$ docker compose up -d
$ docker-compose up -d
WARNING: Some services (minecraft) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use `docker stack deploy` to deploy to a swarm.
Creating network "minecraft_default" with the default driver
Creating minecraft_minecraft_1 ... done
```
Note: this is using a volume in order to store Minecraft server data, that can be recovered if you remove the container and restart it.
Note: this is using a volume in order to store Minecraft server data, that can be recovered if you remove the container and restart it.
## Expected result
@@ -49,7 +52,7 @@ CONTAINER ID IMAGE COMMAND CREATED
After running `docker-compose up`, the minecraft server takes a bit of time to initialize Minecraft world. You can follow the progress:
```
$ docker compose logs
$ docker-compose logs
...
minecraft_1 | [15:06:39] [Worker-Main-6/INFO]: Preparing spawn area: 94%
minecraft_1 | [15:06:39] [Worker-Main-7/INFO]: Preparing spawn area: 94%
@@ -63,20 +66,20 @@ minecraft_1 | [15:06:39] [RCON Listener #1/INFO]: RCON running on 0.0.0.0:25575
Once it is initialized, run your Minecraft application, hit "Play", then "Multiplayer" and "Add server"
![add server](screenshots/click-add-server.png)
Specify your new server IP : localhost:25565
![server configuration](screenshots/add-server-config.png)
Specify your new server IP : localhost:25565
![server configuration](screenshots/add-server-config.png)
You can then start playing
![ready to play](screenshots/ready-to-play.png)
You can then start playing
![ready to play](screenshots/ready-to-play.png)
Stop and remove the containers
```
$ docker compose down
$ docker-compose down
```
To delete all data, remove all named volumes by passing the -v arguments:
```
$ docker compose down -v
```
$ docker-compose down -v
```