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

build(docker): drop build-essential from Docker image #25170

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

sebastianliebscher
Copy link
Contributor

@sebastianliebscher sebastianliebscher commented Sep 3, 2023

SUMMARY

This PR practically drops the apt package build-essential (gcc etc.) from the Docker image, by removing it in the same step it got installed. This package is needed solely to install python-ldap and mysqlclient (from requirements/development.txt).

Important: Users building on top of apache/superset would have to install these tools themselves potentially breaking their Dockerfile depending on their usage.


Also removed because not needed:

  • rm /var/[log,tmp]/*: Both dirs are empty.
  • rm /tmp/*: Basically empty except for a single file from upstream Python Docker image. Removing this file wouldn't save image size.
  • apt-get clean: runs automatically for debian-based docker images.

(already merged)

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

This results in a smaller image:

  • uncompressed: 1.29 GB down to 1.04 GB
  • compressed: 382 MB down to 311 MB

TESTING INSTRUCTIONS

  • check if the image builds: docker build . -t test
  • run docker-compose.yml based on that image and check if all services are running
  • successfully run integration tests on that docker stack
  • successfully run unit test
  • check GitHub CI

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@sebastianliebscher sebastianliebscher changed the title refactor(docker): drop build-essential from Docker image build(docker): drop build-essential from Docker image Sep 3, 2023
@sfirke
Copy link
Member

sfirke commented Sep 6, 2023

I follow the idea and it looks nice to reduce the image size and simplify the Dockerfile!

Thanks for flagging the breaking change aspect. Because of that I wonder if this would be a good candidate for a breaking version. Maybe something to discuss on the dev@apache email list? The safest thing would be to insert it into a breaking change window ahead of 4.0.0 but perhaps it's okay to do this before then as it would be a few months out most likely.

@pull-request-size pull-request-size bot added size/XS and removed size/S labels Oct 6, 2023
@sfirke sfirke added the hold! On hold label Jan 19, 2024
@sfirke
Copy link
Member

sfirke commented May 17, 2024

@sebastianliebscher hope you are well! I see this PR just merged and it reminded me of this one. Should this now be closed as already accomplished via the other PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants