From 9a56e25077b861ae9103781015996d597c4c9064 Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 27 Mar 2023 22:25:47 +0200 Subject: [PATCH] Environment variabeles --- Dockerfile | 9 +++++++-- run.sh | 18 +++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c12d0e..036acdd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,10 +48,15 @@ VOLUME /images EXPOSE 5000 EXPOSE 5001 +ENV SPACE 16G +ENV URL https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_VirtualDSM_42218.pat + +#ENV URL https://global.synologydownload.com/download/DSM/beta/7.2/64216/DSM_VirtualDSM_64216.pat +#ENV URL https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_VirtualDSM_42218.pat +#ENV URL https://global.synologydownload.com/download/DSM/release/7.1.1/42962-1/DSM_VirtualDSM_42962.pat + ENTRYPOINT ["/run/run.sh"] # Mostly users will probably want to configure memory usage. CMD ["-m", "512M"] - - diff --git a/run.sh b/run.sh index 56ef6e2..cb93e81 100755 --- a/run.sh +++ b/run.sh @@ -9,14 +9,9 @@ set -eu FILE="/images/dsm.pat" if [ ! -f "$FILE" ]; then - echo "Downloading Synology DSM..." + echo "Downloading Synology DSM from $URL..." - BASE="https://global.synologydownload.com/download/DSM" - #PAT="$BASE/beta/7.2/64216/DSM_VirtualDSM_64216.pat" - #PAT="$BASE/release/7.1.1/42962-1/DSM_VirtualDSM_42962.pat" - PAT="$BASE/release/7.0.1/42218/DSM_VirtualDSM_42218.pat" - - wget $PAT -O $FILE -q --show-progress + wget $URL -O $FILE -q --show-progress echo "Extracting DSM boot image..." @@ -24,7 +19,7 @@ if [ ! -f "$FILE" ]; then mkdir -p /images/out if { tar tf "$FILE"; } >/dev/null 2>&1; then - tar xf $FILE -C /images/out/. + tar xpf $FILE -C /images/out/. else export LD_LIBRARY_PATH="/run" /run/syno_extract_system_patch $FILE /images/out/. @@ -65,9 +60,10 @@ if [ ! -f "$FILE" ]; then echo -n "Installing system partition..." - tar -xf $HDA.tar --absolute-names --checkpoint=.1000 -C /mnt/tmp/ + tar xpf $HDA.tar --absolute-names --checkpoint=.2000 -C /mnt/tmp/ - echo "\nUnmounting disk template..." + echo "" + echo "Unmounting disk template..." rm $HDA.tar @@ -98,7 +94,7 @@ fi FILE="/images/data.img" if [ ! -f "$FILE" ]; then - truncate -s 16G $FILE + truncate -s $SPACE $FILE mkfs.ext4 -q $FILE fi