mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-03 15:34:18 +00:00
Updated example snippets for CF_PAGE_URL and CF_SLUG (#3740)
This commit is contained in:
+23
-6
@@ -13,9 +13,30 @@ latest snapshot. See the _Versions_ section below for more information.
|
|||||||
|
|
||||||
To simply use the latest stable version, run
|
To simply use the latest stable version, run
|
||||||
|
|
||||||
docker run -d -it --pull=always -p 25565:25565 -e EULA=TRUE itzg/minecraft-server
|
docker run -d -it -p 25565:25565 -e EULA=TRUE itzg/minecraft-server
|
||||||
|
|
||||||
where, in this case, the standard server port 25565, will be exposed on your host machine.
|
where, in this case, the standard server port 25565 will be exposed on your host machine.
|
||||||
|
|
||||||
|
!!! important "Persistent Data"
|
||||||
|
|
||||||
|
The Minecraft server will store its data in the container's `/data` directory. This directory can be [mounted](https://docs.docker.com/storage/volumes/) from the host machine or a managed volume.
|
||||||
|
|
||||||
|
Using `docker run` add a `-v` option somewhere before the image name:
|
||||||
|
|
||||||
|
```
|
||||||
|
... -v /path/on/host:/data itzg/minecraft-server
|
||||||
|
```
|
||||||
|
|
||||||
|
Using docker compose, add a `volumes` section to the service definition:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
# ... image and environment section
|
||||||
|
volumes:
|
||||||
|
# attach the relative directory 'data' to the container's /data path
|
||||||
|
./data:data
|
||||||
|
```
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
|
|
||||||
@@ -25,10 +46,6 @@ where, in this case, the standard server port 25565, will be exposed on your hos
|
|||||||
|
|
||||||
Be sure to always include `-e EULA=TRUE` in your commands and container definitions, as Mojang/Microsoft requires EULA acceptance.
|
Be sure to always include `-e EULA=TRUE` in your commands and container definitions, as Mojang/Microsoft requires EULA acceptance.
|
||||||
|
|
||||||
!!! warning
|
|
||||||
|
|
||||||
**DO NOT** port forward RCON on 25575 without first setting `RCON_PASSWORD` to a secure value. It is highly recommended to only use RCON within the container, such as with `rcon-cli`.
|
|
||||||
|
|
||||||
By default, the container will download the latest version of the "vanilla" [Minecraft: Java Edition server](https://www.minecraft.net/en-us/download/server) provided by Mojang. The [`VERSION`](versions/minecraft.md) and the [`TYPE`](types-and-platforms/index.md) can be configured to create many variations of desired Minecraft server.
|
By default, the container will download the latest version of the "vanilla" [Minecraft: Java Edition server](https://www.minecraft.net/en-us/download/server) provided by Mojang. The [`VERSION`](versions/minecraft.md) and the [`TYPE`](types-and-platforms/index.md) can be configured to create many variations of desired Minecraft server.
|
||||||
|
|
||||||
## Using [Docker Compose](https://docs.docker.com/compose/)
|
## Using [Docker Compose](https://docs.docker.com/compose/)
|
||||||
|
|||||||
@@ -71,20 +71,41 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat
|
|||||||
|
|
||||||
Use one of the following to specify the modpack to install:
|
Use one of the following to specify the modpack to install:
|
||||||
|
|
||||||
Pass a page URL to the modpack or a specific file with `CF_PAGE_URL` such as the modpack page "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8" or a specific file "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8/files/4248390". For example:
|
Pass a page URL to the modpack or a specific file with `CF_PAGE_URL` such as the modpack page "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8" or a specific file "https://www.curseforge.com/minecraft/modpacks/all-the-mods-8/files/4248390".
|
||||||
|
|
||||||
```
|
!!! example "Using CF_PAGE_URL"
|
||||||
-e TYPE=AUTO_CURSEFORGE -e CF_PAGE_URL=https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
|
|
||||||
```
|
```yaml title="Using compose.yaml"
|
||||||
|
environment:
|
||||||
|
# ...
|
||||||
|
MODPACK_PLATFORM: AUTO_CURSEFORGE
|
||||||
|
# allocate from https://console.curseforge.com/ and set in .env file
|
||||||
|
CF_API_KEY: ${CF_API_KEY}
|
||||||
|
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
|
||||||
|
```
|
||||||
|
|
||||||
|
```title="Using docker run"
|
||||||
|
docker run -e CF_API_KEY=${CF_API_KEY} -e TYPE=AUTO_CURSEFORGE -e CF_PAGE_URL=https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
|
||||||
|
```
|
||||||
|
|
||||||
Instead of a URL, the modpack slug can be provided as `CF_SLUG`. The slug is the short identifier visible in the URL after "/modpacks/", such as
|
Instead of a URL, the modpack slug can be provided as `CF_SLUG`. The slug is the short identifier visible in the URL after "/modpacks/", such as
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
For example:
|
!!! example "Using CF_SLUG"
|
||||||
```
|
|
||||||
-e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8
|
```yaml title="Using compose.yaml"
|
||||||
```
|
environment:
|
||||||
|
# ...
|
||||||
|
MODPACK_PLATFORM: AUTO_CURSEFORGE
|
||||||
|
# allocate from https://console.curseforge.com/ and set in .env file
|
||||||
|
CF_API_KEY: ${CF_API_KEY}
|
||||||
|
CF_SLUG: all-the-mods-8
|
||||||
|
```
|
||||||
|
|
||||||
|
```title="Using docker run"
|
||||||
|
docker run -e CF_API_KEY=${CF_API_KEY} -e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8
|
||||||
|
```
|
||||||
|
|
||||||
### Pinning modpack and mod loader versions
|
### Pinning modpack and mod loader versions
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user