Skip to content

Commit 04dc1bc

Browse files
Make the docker:dind image configurable:
Allows users to specify specific versions of docker:dind to use. Signed-off-by: Jacob Weinstock <[email protected]>
1 parent d0d5e0f commit 04dc1bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

images/hook-embedded/pull-images.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function main() {
1818
local dind_container="$1"
1919
local images_file="$2"
2020
local arch="$3"
21+
local dind_container_image="$4"
2122
# as this function maybe called multiple times, we need to ensure the container is removed
2223
trap "docker rm -f "${dind_container}" &> /dev/null" RETURN
2324
# we're using set -e so the trap on RETURN will not be executed when a command fails
@@ -28,7 +29,7 @@ function main() {
2829
# will change the permissions of the bind mount directory (images/) to root.
2930
echo -e "Starting DinD container"
3031
echo -e "-----------------------"
31-
docker run -d --rm --privileged --name "${dind_container}" -v ${PWD}/images/:/var/lib/docker-embedded/ -d docker:dind
32+
docker run -d --rm --privileged --name "${dind_container}" -v ${PWD}/images/:/var/lib/docker-embedded/ -d "${dind_container_image}"
3233

3334
# wait until the docker daemon is ready
3435
until docker exec "${dind_container}" docker info &> /dev/null; do
@@ -58,4 +59,5 @@ function main() {
5859
arch="${1-amd64}"
5960
dind_container_name="hookos-dind-${arch}"
6061
images_file="images.txt"
61-
main "${dind_container_name}" "${images_file}" "${arch}"
62+
dind_container_image="${2-docker:dind}"
63+
main "${dind_container_name}" "${images_file}" "${arch}" "${dind_container_image}"

0 commit comments

Comments
 (0)