Skip to content

Commit

Permalink
Merge pull request #58 from markdumay/develop
Browse files Browse the repository at this point in the history
Fix Docker Compose download path
  • Loading branch information
markdumay authored Nov 26, 2021
2 parents 743dcc4 + 10952a4 commit f83ee14
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Detailed background information is available on the author's [personal blog][blo
The project uses [Docker][docker_url], a lightweight virtualization application.

## Prerequisites
*Synology-Docker* runs on a Synology NAS with DSM 6 or DSM 7. The script has been tested with a DS918+ running DSM 6.2.4-25556 and DSM 7.0-41890. Other prerequisites are:
*Synology-Docker* runs on a Synology NAS with DSM 6 or DSM 7. The script has been tested with a DS918+ running DSM 6.2.4-25556 and DSM 7.0.1-42218. Other prerequisites are:

* **SSH admin access is required** - *Synology-Docker* runs as a shell script on the terminal. You can enable SSH access in DSM under `Control Panel ➡ Terminal & SNMP ➡ Terminal`.

Expand Down
22 changes: 16 additions & 6 deletions syno_docker_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# Title : syno_docker_update.sh
# Description : An Unofficial Script to Update or Restore Docker Engine and Docker Compose on Synology
# Author : Mark Dumay
# Date : September 17th, 2021
# Version : 1.4.0
# Date : November 26th, 2021
# Version : 1.4.1
# Usage : sudo ./syno_docker_update.sh [OPTIONS] COMMAND
# Repository : https://github.com/markdumay/synology-docker.git
# License : MIT - https://github.com/markdumay/synology-docker/blob/master/LICENSE
Expand All @@ -20,8 +20,8 @@ readonly RED='\e[31m' # Red color
readonly NC='\e[m' # No color / reset
readonly BOLD='\e[1m' # Bold font
readonly DSM_SUPPORTED_VERSION=6
readonly DEFAULT_DOCKER_VERSION='20.10.8'
readonly DEFAULT_COMPOSE_VERSION='1.29.2'
readonly DEFAULT_DOCKER_VERSION='20.10.11'
readonly DEFAULT_COMPOSE_VERSION='2.1.1'
readonly CPU_ARCH='x86_64'
readonly DOWNLOAD_DOCKER="https://download.docker.com/linux/static/stable/${CPU_ARCH}"
readonly DOWNLOAD_GITHUB='https://github.com/docker/compose'
Expand Down Expand Up @@ -741,7 +741,9 @@ execute_extract_backup() {
}

#======================================================================================================================
# Downloads the targeted Docker Compose binary, unless instructed to skip the download.
# Downloads the targeted Docker Compose binary, unless instructed to skip the download. As the download path has
# changed since release of Docker Compose v2, this function checks the major version of the target binary and updates
# the path accordingly.
#======================================================================================================================
# Globals:
# - download_dir
Expand All @@ -752,7 +754,15 @@ execute_extract_backup() {
#======================================================================================================================
execute_download_compose() {
if [ "${skip_compose_update}" = 'false' ] ; then
compose_bin="${DOWNLOAD_GITHUB}/releases/download/${target_compose_version}/docker-compose-Linux-${CPU_ARCH}"
major_compose=$(echo "${target_compose_version}" | cut -d" " -f3 | cut -d "." -f1)
base_path="${DOWNLOAD_GITHUB}/releases/download"
# as of version 2, the download path uses a 'v' prefix and is in lower case
compose_bin="${base_path}/v${target_compose_version}/docker-compose-linux-${CPU_ARCH}"
if [ "${major_compose}" -lt 2 ] ; then
# below version 2, the download path does not use a 'v' prefix and uses sentence case for the platform
compose_bin="${base_path}/${target_compose_version}/docker-compose-Linux-${CPU_ARCH}"
fi

print_status "Downloading target Docker Compose binary (${compose_bin})"
response=$(curl -L "${compose_bin}" --write-out '%{http_code}' -o "${download_dir}/docker-compose")
if [ "${response}" != 200 ] ; then
Expand Down

0 comments on commit f83ee14

Please sign in to comment.