Skip to content

Add parallel pull for docker images for testcontainers - #176

Merged
rnc merged 3 commits into
project-ncl:mainfrom
rnc:DOCKER
Nov 10, 2026
Merged

rnc merged 3 commits into
project-ncl:mainfrom
rnc:DOCKER

Conversation

@rnc

@rnc rnc commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Inspired by https://github.com/entur/gha-testcontainers but that doesn't support just passing a String list of image names.

base="${RUNNER_TEMP}/pre-pull/$((++n))"
echo "${image}" > "${base}.log"
# shellcheck disable=SC2016
setsid bash -c 'docker pull -- "$1" >> "$2.log" 2>&1; echo "$? ${SECONDS}" > "$2.rc"' _ "${image}" "${base}" > /dev/null 2>&1 < /dev/null &

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the setsid thing? Just curious about it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setsid starts the pull in its own session and process group, so it is detached from the step's shell. This allows it do the pull while the build runs in parallel - so by the time orch gets to e.g. the integration-test-rex, the pull will already have been done.

@rnc
rnc merged commit 4dc4f49 into project-ncl:main Nov 10, 2026
2 checks passed
@rnc
rnc deleted the DOCKER branch November 10, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants