mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-10 18:45:09 +00:00
Fix loading world from compressed tar archives (#1304)
This commit is contained in:
@@ -20,6 +20,7 @@ RUN apt-get update \
|
|||||||
rsync \
|
rsync \
|
||||||
nano \
|
nano \
|
||||||
unzip \
|
unzip \
|
||||||
|
zstd \
|
||||||
knockd \
|
knockd \
|
||||||
ttf-dejavu \
|
ttf-dejavu \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
|
|||||||
+13
-9
@@ -195,12 +195,16 @@ function extract() {
|
|||||||
destDir=${2?}
|
destDir=${2?}
|
||||||
|
|
||||||
type=$(file -b --mime-type "${src}")
|
type=$(file -b --mime-type "${src}")
|
||||||
if [[ $type == application/zip ]]; then
|
case "${type}" in
|
||||||
unzip -q -d "${destDir}" "${src}"
|
application/zip)
|
||||||
elif [[ $type == application/x-tar ]]; then
|
unzip -q -d "${destDir}" "${src}"
|
||||||
tar -C "${destDir}" -xf "${src}"
|
;;
|
||||||
else
|
application/x-tar|application/gzip|application/x-bzip2|application/zstd)
|
||||||
log "ERROR: unsupported archive type: $type"
|
tar -C "${destDir}" -xf "${src}"
|
||||||
return 1
|
;;
|
||||||
fi
|
*)
|
||||||
}
|
log "ERROR: unsupported archive type: $type"
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ services:
|
|||||||
EULA: "TRUE"
|
EULA: "TRUE"
|
||||||
SETUP_ONLY: "TRUE"
|
SETUP_ONLY: "TRUE"
|
||||||
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||||
WORLD: /worlds/world-for-testing.tgz
|
WORLD: /worlds/world-for-testing.tar
|
||||||
volumes:
|
volumes:
|
||||||
- ./worlds:/worlds:ro
|
- ./worlds:/worlds:ro
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
restart: "no"
|
||||||
|
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
SETUP_ONLY: "TRUE"
|
||||||
|
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||||
|
WORLD: /worlds/world-for-testing.tar.bz2
|
||||||
|
volumes:
|
||||||
|
- ./worlds:/worlds:ro
|
||||||
|
- ./data:/data
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
mc-image-helper assert fileExists world/level.dat
|
||||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
restart: "no"
|
||||||
|
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
SETUP_ONLY: "TRUE"
|
||||||
|
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||||
|
WORLD: /worlds/world-for-testing.tar.gz
|
||||||
|
volumes:
|
||||||
|
- ./worlds:/worlds:ro
|
||||||
|
- ./data:/data
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
mc-image-helper assert fileExists world/level.dat
|
||||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
restart: "no"
|
||||||
|
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
SETUP_ONLY: "TRUE"
|
||||||
|
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||||
|
WORLD: /worlds/world-for-testing.tar.zst
|
||||||
|
volumes:
|
||||||
|
- ./worlds:/worlds:ro
|
||||||
|
- ./data:/data
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
mc-image-helper assert fileExists world/level.dat
|
||||||
Binary file not shown.
Reference in New Issue
Block a user