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

fix(docker): optimize docker build by better utilizing build cache #23624

Merged
merged 2 commits into from
Apr 13, 2023

Conversation

sebastianliebscher
Copy link
Contributor

SUMMARY

The chown -R command causes the /app directory contents from previous COPY's to be copied up to the current layer. This results in additional redundant image size.
By using COPY --chown we can reduce the image size by ~130 MB.

Also

  • remove duplicate COPY setup.py MANIFEST.in README.md /app/
  • adjust indentation
  • fix pip install option from --no-cache to --no-cache-dir

TESTING INSTRUCTIONS

docker build -t superset --no-cache .

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

@EugeneTorap
Copy link
Contributor

Hi @villebro @dpgaspar! Would you like to review this interesting PR?

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM, great improvements and TIL about COPY --chown! Ping @dpgaspar @craig-rueda

@villebro villebro requested a review from dpgaspar April 13, 2023 08:26
@rusackas rusackas merged commit 536b1c4 into apache:master Apr 13, 2023
@sebastianliebscher sebastianliebscher deleted the optimize-dockerfile branch April 20, 2023 16:24
sebastianliebscher added a commit to sebastianliebscher/superset that referenced this pull request Apr 28, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants