Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install build-essential to compile dependencies and use multi-stage build #2582

Merged
merged 4 commits into from Nov 1, 2021

Conversation

vbarbaresi
Copy link
Contributor

@vbarbaresi vbarbaresi commented Oct 31, 2021

  • Install build-essential to avoid build issues like Docker upload CI is broken #2568 when dependencies don't have prebuilt wheels available
  • Removed regex pinned version: not necessary as we can build from source if wheels are missing
  • Use multi-stage build instead of trying to purge packages and cache from the image
    Copying /root/.local/ installs only black's built Python dependencies (< 20 MB).
    So the image is barely larger than python:3-slim base image

Tested locally and in my fork GitHub Actions: https://github.com/vbarbaresi/black/runs/4062490765?check_suite_focus=true

- Install build-essential to avoid build issues like psf#2568 when dependencies don't have prebuilt wheels available
- Use multi-stage build instead of trying to purge packages and cache from the image
  Copying `/root/.local/` installs only black's built Python dependencies (< 20 MB).
  So the image is barely larger than python:3-slim base image
Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

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

Awesome, thanks! Nice use of --user to get all the artifacts in an easy place to copy.

@JelleZijlstra JelleZijlstra merged commit bd96130 into psf:main Nov 1, 2021
@vbarbaresi vbarbaresi deleted the docker_build_tools branch November 1, 2021 09:14
JelleZijlstra pushed a commit that referenced this pull request Nov 16, 2021
…build (#2582)

- Install build-essential to avoid build issues like #2568 when dependencies don't have prebuilt wheels available
- Use multi-stage build instead of trying to purge packages and cache from the image
  Copying `/root/.local/` installs only black's built Python dependencies (< 20 MB).
  So the image is barely larger than python:3-slim base image
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.

None yet

3 participants