fix: force interactive login shell for bash containers
Detached containers with tty: true still exited immediately because a plain /bin/bash invocation exits with code 0 when stdin is not connected. - Detect when the container CMD is /bin/bash or bash and exec an interactive login shell () after dropping privileges - Keep the generic path for non-shell commands - Bump compiler_version to v4 to force a fresh image build Quality gates: - pytest tests/unit: 219 passed - ruff: clean on changed files - mypy: clean on changed files
This commit is contained in:
@@ -270,6 +270,7 @@ def test_compile_dockerfile_starts_as_root_and_drops_privileges() -> None:
|
||||
entrypoint = compile_entrypoint(manifest)
|
||||
|
||||
assert "USER dev" not in dockerfile
|
||||
assert 'exec runuser -u dev -- /bin/bash -il' in entrypoint
|
||||
assert 'exec runuser -u dev -- "$@"' in entrypoint
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user