Skip to content

Commit

Permalink
Adding entrypoint to podman create to be able to create container wit…
Browse files Browse the repository at this point in the history
…h binaryless image

[CLOUDDST-23087]
  • Loading branch information
lipoja authored and JAVGan committed Jan 20, 2025
1 parent fb7c9fc commit 9355702
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion iib/workers/tasks/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ def _copy_files_from_image(image: str, src_path: str, dest_path: str) -> None:
# podman.
container_command = 'unused'
container_id = run_cmd(
['podman', 'create', image, container_command],
['podman', 'create', '--entrypoint', '""', image, container_command],
exc_msg=f'Failed to create a container for {image}',
).strip()
try:
Expand Down
4 changes: 3 additions & 1 deletion tests/test_workers/test_tasks/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,9 @@ def test_copy_files_from_image(mock_podman_pull, mock_run_cmd, fail_rm):

mock_run_cmd.assert_has_calls(
[
mock.call(['podman', 'create', image, 'unused'], exc_msg=mock.ANY),
mock.call(
['podman', 'create', '--entrypoint', '""', image, 'unused'], exc_msg=mock.ANY
),
mock.call(['podman', 'cp', f'{container_id}:{src_path}', dest_path], exc_msg=mock.ANY),
mock.call(['podman', 'rm', container_id], exc_msg=mock.ANY),
]
Expand Down

0 comments on commit 9355702

Please sign in to comment.