superset icon indicating copy to clipboard operation
superset copied to clipboard

build(docker): drop `build-essential` from Docker image

Open sebastianliebscher opened this issue 1 year ago • 2 comments

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 avatar Sep 03 '23 09:09 sebastianliebscher