mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-12 13:22:28 +00:00
Corrected Fabric installer variables in README
This commit is contained in:
parent
6cfc7e45ef
commit
0ddabf3089
2 changed files with 29 additions and 29 deletions
34
README.md
34
README.md
|
@ -557,29 +557,31 @@ Just change it with `SPONGEBRANCH`, such as:
|
|||
|
||||
## Running a Fabric Server
|
||||
|
||||
Enable Fabric server mode by adding a `-e TYPE=FABRIC` to your command-line.
|
||||
By default the container will run the latest version of [Fabric server](http://fabricmc.net/use/)
|
||||
but you can also choose to run a specific version with `-e FABRICVERSION=0.5.0.32`.
|
||||
Enable [Fabric server](http://fabricmc.net/use/) mode by adding a `-e TYPE=FABRIC` to your command-line. By default, the container will run the latest version, but you can also choose to run a specific version with `VERSION`.
|
||||
|
||||
$ docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=FABRIC -e FABRICVERSION=0.5.0.32 \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
```
|
||||
docker run -d -v /path/on/host:/data \
|
||||
-e TYPE=FABRIC \
|
||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
||||
```
|
||||
|
||||
To use a pre-downloaded Fabric installer, place it in the attached `/data` directory and
|
||||
specify the name of the installer file with `FABRIC_INSTALLER`, such as:
|
||||
A specific installer version can be requested using `FABRIC_INSTALLER_VERSION`.
|
||||
|
||||
$ docker run -d -v /path/on/host:/data ... \
|
||||
-e FABRIC_INSTALLER=fabric-installer-0.5.0.32.jar ...
|
||||
To use a pre-downloaded Fabric installer, place it in a directory attached into the container, such as the `/data` volume and specify the name of the installer file with `FABRIC_INSTALLER`, such as:
|
||||
|
||||
To download a Fabric installer from a custom location, such as your own file repository, specify
|
||||
the URL with `FABRIC_INSTALLER_URL`, such as:
|
||||
```
|
||||
docker run -d -v /path/on/host:/data ... \
|
||||
-e FABRIC_INSTALLER=fabric-installer-0.5.0.32.jar ...
|
||||
```
|
||||
|
||||
$ docker run -d -v /path/on/host:/data ... \
|
||||
-e FORGE_INSTALLER_URL=http://HOST/fabric-installer-0.5.0.32.jar ...
|
||||
To download a Fabric installer from a custom location, such as your own file repository, specify the URL with `FABRIC_INSTALLER_URL`, such as:
|
||||
|
||||
In both of the cases above, there is no need for the `VERSION` or `FABRICVERSION` variables.
|
||||
```
|
||||
docker run -d -v /path/on/host:/data ... \
|
||||
-e FABRIC_INSTALLER_URL=http://HOST/fabric-installer-0.5.0.32.jar ...
|
||||
```
|
||||
|
||||
In order to add mods, you have two options.
|
||||
In order to add mods, you have two options:
|
||||
|
||||
### Using the /data volume
|
||||
|
||||
|
|
|
@ -7,36 +7,34 @@ export TYPE=FABRIC
|
|||
|
||||
FABRIC_INSTALLER=${FABRIC_INSTALLER:-}
|
||||
FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-}
|
||||
FABRICVERSION=${FABRICVERSION:-LATEST}
|
||||
FABRIC_INSTALLER_VERSION=${FABRIC_INSTALLER_VERSION:-${FABRICVERSION:-LATEST}}
|
||||
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
||||
log "Checking Fabric version information."
|
||||
case $FABRICVERSION in
|
||||
case $FABRIC_INSTALLER_VERSION in
|
||||
LATEST)
|
||||
FABRIC_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
||||
;;
|
||||
|
||||
*)
|
||||
FABRIC_VERSION=$FABRICVERSION
|
||||
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
||||
;;
|
||||
esac
|
||||
|
||||
FABRIC_INSTALLER="/tmp/fabric-installer-$FABRIC_VERSION.jar"
|
||||
FABRIC_INSTALLER="/tmp/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||
markerVersion=$FABRIC_INSTALLER_VERSION
|
||||
|
||||
elif [[ -z $FABRIC_INSTALLER ]]; then
|
||||
FABRIC_INSTALLER="/tmp/fabric-installer.jar"
|
||||
markerVersion=custom
|
||||
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
installMarker="/data/.fabric-installed-${VANILLA_VERSION}-${FABRIC_VERSION:-manual}"
|
||||
installMarker="/data/.fabric-installed-${VANILLA_VERSION}-${markerVersion}"
|
||||
|
||||
debug Checking for installMarker ${installMarker}
|
||||
if [[ ! -e $installMarker ]]; then
|
||||
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||
if [[ -z $FABRIC_INSTALLER_URL ]]; then
|
||||
log "Downloading $FABRIC_VERSION"
|
||||
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/$FABRIC_VERSION/fabric-installer-$FABRIC_VERSION.jar"
|
||||
log "Downloading installer version $FABRIC_INSTALLER_VERSION"
|
||||
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||
log "...trying $downloadUrl"
|
||||
curl -o $FABRIC_INSTALLER -fsSL $downloadUrl
|
||||
else
|
||||
|
@ -49,9 +47,9 @@ if [[ ! -e $installMarker ]]; then
|
|||
fi
|
||||
|
||||
if isDebugging; then
|
||||
debug "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER with mcversion ${VANILLA_VERSION}"
|
||||
debug "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER"
|
||||
else
|
||||
log "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER"
|
||||
log "Installing Fabric using $FABRIC_INSTALLER"
|
||||
fi
|
||||
tries=3
|
||||
set +e
|
||||
|
|
Loading…
Reference in a new issue