install dind-hack script according to docker engine version

This commit is contained in:
sebthom 2024-03-12 14:44:39 +01:00
parent e20189b7ea
commit 2d2488945b
1 changed files with 3 additions and 3 deletions

View File

@ -126,9 +126,6 @@ RUN --mount=type=bind,source=.shared,target=/mnt/shared <<EOF
echo 'dockremap:165536:65536' | tee -a /etc/subuid
echo 'dockremap:165536:65536' | tee -a /etc/subgid
curl "https://raw.githubusercontent.com/moby/moby/v24.0.2/hack/dind" -o /usr/local/bin/dind-hack
chmod +x /usr/local/bin/dind-hack
if [[ $FLAVOR == dind-rootless ]]; then
# https://docs.docker.com/engine/security/rootless/
(set -x; apt-get install --no-install-recommends -y \
@ -146,6 +143,9 @@ RUN --mount=type=bind,source=.shared,target=/mnt/shared <<EOF
mkdir /opt/containerd
chown act:act /opt/containerd
else
docker_version=$(docker --version | cut -d ' ' -f3 | cut -d ',' -f1)
curl "https://raw.githubusercontent.com/moby/moby/v${docker_version}/hack/dind" -o /usr/local/bin/dind-hack
chmod +x /usr/local/bin/dind-hack
usermod -aG docker act
fi
fi