Skip to content

Comments

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

Merged
JelleZijlstra merged 4 commits intopsf:mainfrom
vbarbaresi:docker_build_tools
Nov 1, 2021
Merged

install build-essential to compile dependencies and use multi-stage build #2582
JelleZijlstra merged 4 commits intopsf:mainfrom
vbarbaresi:docker_build_tools

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.

3 participants