Skip to content

Commit 5b6567b

Browse files
committed
Running git cli container as a non root user
1 parent 092c6ae commit 5b6567b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/bci_build/package/git.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from bci_build.os_version import ALL_NONBASE_OS_VERSIONS
55
from bci_build.os_version import CAN_BE_LATEST_OS_VERSION
66
from bci_build.package import ApplicationStackContainer
7+
from bci_build.package import DOCKERFILE_RUN
78
from bci_build.package.helpers import generate_from_image_tag
89
from bci_build.package.helpers import generate_package_version_check
910
from bci_build.package.versions import format_version
@@ -43,6 +44,10 @@
4344
"git-core",
4445
"openssh-clients",
4546
],
47+
custom_end=rf"""{DOCKERFILE_RUN} mkdir -p /workspace && chgrp 0 /workspace && chmod g=u /workspace && chmod 1777 /workspace
48+
WORKDIR /workspace
49+
ENV HOME=/workspace
50+
""",
4651
build_stage_custom_end=generate_package_version_check(
4752
"git-core", git_version, ParseVersion.MINOR, use_target=True
4853
),

0 commit comments

Comments
 (0)