Skip to content

Conversation

@ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented Oct 8, 2024

  • 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.

@ssbarnea ssbarnea requested a review from a team as a code owner October 8, 2024 13:23
@ssbarnea ssbarnea mentioned this pull request Oct 8, 2024
- 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.
@sonarqubecloud
Copy link

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')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using -q hides some install info that could be useful in debugging user issues. I'd prefer to not use this.

I did notice that it did subtract about 1.5 seconds on a very simple build, and the resulting image sizes did not seem to change by any significant amount.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants