forked from portainer/agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·29 lines (21 loc) · 717 Bytes
/
Copy pathsetup.sh
File metadata and controls
executable file
·29 lines (21 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
PLATFORM=${1:-"linux"}
ARCH=${2:-"amd64"}
BINARY_VERSION_FILE="./binary-version.json"
dockerVersion=$(jq -r '.docker' < "${BINARY_VERSION_FILE}")
mkdir -p dist/
echo "Checking and downloading binaries for docker ${dockerVersion}"
# Determine the binary file names based on the platform
dockerBinary="dist/docker"
if [ "$PLATFORM" == "windows" ]; then
dockerBinary="dist/docker.exe"
fi
# Check and download docker binary
if [ ! -f "$dockerBinary" ]; then
echo "Downloading docker binary..."
/usr/bin/env bash ./build/download_docker_binary.sh "$PLATFORM" "$ARCH" "$dockerVersion"
else
echo "Docker binary already exists, skipping download."
fi