Skip to content

Commit fbb335f

Browse files
committed
Quote docker .data-root in jq expression
1 parent 1a7ada4 commit fbb335f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packer/linux/conf/bin/bk-check-disk-space.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -euo pipefail
44
DISK_MIN_AVAILABLE=${DISK_MIN_AVAILABLE:-5242880} # 5GB
55
DISK_MIN_INODES=${DISK_MIN_INODES:-250000} # docker needs lots
66

7-
DOCKER_DIR="/var/lib/docker/"
7+
DOCKER_DIR="$(jq -r '."data-root" // "/var/lib/docker"' /etc/docker/daemon.json)"
88

99
disk_avail=$(df -k --output=avail "$DOCKER_DIR" | tail -n1)
1010

packer/linux/conf/bin/bk-configure-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ fi
2020

2121
# Move docker root to the ephemeral device
2222
if [[ "${BUILDKITE_ENABLE_INSTANCE_STORAGE:-false}" == "true" ]] ; then
23-
cat <<< "$(jq '.data-root="/mnt/ephemeral/docker"' /etc/docker/daemon.json)" > /etc/docker/daemon.json
23+
cat <<< "$(jq '."data-root"="/mnt/ephemeral/docker"' /etc/docker/daemon.json)" > /etc/docker/daemon.json
2424
fi

0 commit comments

Comments
 (0)