Skip to content

Commit 9822112

Browse files
committed
Improve execution of pip during container building
- Make pip less verbose as this makes harder to investigate container building due to being too verbose. - Use a bind mount to prevent pip cache from being written inside the container but still make use of it. This will speed-up the build process considerably.
1 parent 16a5dce commit 9822112

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ansible_builder/containerfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def prepare(self) -> None:
9494
self.steps.append('RUN /output/scripts/pip_install $PYCMD')
9595

9696
if self.definition.ansible_ref_install_list:
97-
self.steps.append('RUN $PYCMD -m pip install --no-cache-dir $ANSIBLE_INSTALL_REFS')
97+
self.steps.append('RUN --mount=type=cache,dst=/root/.cache/pip $PYCMD -m pip install -q $ANSIBLE_INSTALL_REFS')
9898

9999
self._insert_custom_steps('append_base')
100100

0 commit comments

Comments
 (0)