Skip to content

Commit 9c1fd73

Browse files
authored
Merge pull request #583 from bitranox/reduce-actions-runner-chown
entrypoint: skip recursive chown over /actions-runner/{bin,externals}
2 parents e323dd3 + a2e24b0 commit 9c1fd73

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

entrypoint.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,14 @@ if [[ ${_RUN_AS_ROOT} == "true" ]]; then
290290
else
291291
if [[ $(id -u) -eq 0 ]]; then
292292
[[ -n "${_CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]] && chown -R runner "${_CONFIGURED_ACTIONS_RUNNER_FILES_DIR}"
293-
chown -R runner "${_RUNNER_WORKDIR}" /actions-runner
293+
# /actions-runner/{bin,externals} ship runner-owned from the image
294+
# (~380 MB / 9k+ files). Recursing over them triggers overlay copy-up
295+
# per file even when ownership already matches, which dominates startup
296+
# under parallel runners. Only config.sh (run as root earlier) may have
297+
# written new root-owned files at the top level — chown those plus
298+
# /actions-runner itself and ${_RUNNER_WORKDIR}, but not the big dirs.
299+
chown runner /actions-runner "${_RUNNER_WORKDIR}"
300+
find /actions-runner -mindepth 1 -maxdepth 1 ! -name bin ! -name externals -exec chown -R runner {} + 2>/dev/null || true
294301
# The toolcache is not recursively chowned to avoid recursing over prepulated tooling in derived docker images
295302
chown runner /opt/hostedtoolcache/
296303
if [[ ${_DEBUG_ONLY} == "true" ]] || [[ ${_DEBUG_OUTPUT} == "true" ]] ; then

0 commit comments

Comments
 (0)