mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-17 22:14:54 +00:00
Corrected Fabric installer variables in README
This commit is contained in:
@@ -557,29 +557,31 @@ Just change it with `SPONGEBRANCH`, such as:
|
|||||||
|
|
||||||
## Running a Fabric Server
|
## Running a Fabric Server
|
||||||
|
|
||||||
Enable Fabric server mode by adding a `-e TYPE=FABRIC` to your command-line.
|
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`.
|
||||||
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`.
|
|
||||||
|
|
||||||
$ docker run -d -v /path/on/host:/data \
|
```
|
||||||
-e TYPE=FABRIC -e FABRICVERSION=0.5.0.32 \
|
docker run -d -v /path/on/host:/data \
|
||||||
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
|
-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
|
A specific installer version can be requested using `FABRIC_INSTALLER_VERSION`.
|
||||||
specify the name of the installer file with `FABRIC_INSTALLER`, such as:
|
|
||||||
|
|
||||||
$ docker run -d -v /path/on/host:/data ... \
|
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:
|
||||||
-e FABRIC_INSTALLER=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:
|
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 ... \
|
To download a Fabric installer from a custom location, such as your own file repository, specify the URL with `FABRIC_INSTALLER_URL`, such as:
|
||||||
-e FORGE_INSTALLER_URL=http://HOST/fabric-installer-0.5.0.32.jar ...
|
|
||||||
|
|
||||||
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
|
### Using the /data volume
|
||||||
|
|
||||||
|
|||||||
+11
-13
@@ -7,36 +7,34 @@ export TYPE=FABRIC
|
|||||||
|
|
||||||
FABRIC_INSTALLER=${FABRIC_INSTALLER:-}
|
FABRIC_INSTALLER=${FABRIC_INSTALLER:-}
|
||||||
FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-}
|
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
|
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
||||||
log "Checking Fabric version information."
|
log "Checking Fabric version information."
|
||||||
case $FABRICVERSION in
|
case $FABRIC_INSTALLER_VERSION in
|
||||||
LATEST)
|
LATEST)
|
||||||
FABRIC_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
FABRIC_VERSION=$FABRICVERSION
|
|
||||||
;;
|
;;
|
||||||
esac
|
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
|
elif [[ -z $FABRIC_INSTALLER ]]; then
|
||||||
FABRIC_INSTALLER="/tmp/fabric-installer.jar"
|
FABRIC_INSTALLER="/tmp/fabric-installer.jar"
|
||||||
|
markerVersion=custom
|
||||||
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||||
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
installMarker="/data/.fabric-installed-${VANILLA_VERSION}-${FABRIC_VERSION:-manual}"
|
installMarker="/data/.fabric-installed-${VANILLA_VERSION}-${markerVersion}"
|
||||||
|
|
||||||
debug Checking for installMarker ${installMarker}
|
debug Checking for installMarker ${installMarker}
|
||||||
if [[ ! -e $installMarker ]]; then
|
if [[ ! -e $installMarker ]]; then
|
||||||
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||||
if [[ -z $FABRIC_INSTALLER_URL ]]; then
|
if [[ -z $FABRIC_INSTALLER_URL ]]; then
|
||||||
log "Downloading $FABRIC_VERSION"
|
log "Downloading installer version $FABRIC_INSTALLER_VERSION"
|
||||||
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/$FABRIC_VERSION/fabric-installer-$FABRIC_VERSION.jar"
|
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||||
log "...trying $downloadUrl"
|
log "...trying $downloadUrl"
|
||||||
curl -o $FABRIC_INSTALLER -fsSL $downloadUrl
|
curl -o $FABRIC_INSTALLER -fsSL $downloadUrl
|
||||||
else
|
else
|
||||||
@@ -49,9 +47,9 @@ if [[ ! -e $installMarker ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if isDebugging; then
|
if isDebugging; then
|
||||||
debug "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER with mcversion ${VANILLA_VERSION}"
|
debug "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER"
|
||||||
else
|
else
|
||||||
log "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER"
|
log "Installing Fabric using $FABRIC_INSTALLER"
|
||||||
fi
|
fi
|
||||||
tries=3
|
tries=3
|
||||||
set +e
|
set +e
|
||||||
|
|||||||
Reference in New Issue
Block a user