Skip to content

Commit

Permalink
Improve execution of pip during container building
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
ssbarnea committed Oct 11, 2024
1 parent 16a5dce commit 9822112
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ansible_builder/containerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def prepare(self) -> None:
self.steps.append('RUN /output/scripts/pip_install $PYCMD')

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

self._insert_custom_steps('append_base')

Expand Down

0 comments on commit 9822112

Please sign in to comment.