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

Reduce Docker Image Size #642

Merged
merged 1 commit into from
May 12, 2024
Merged

Conversation

HeliosLHC
Copy link
Contributor

Reduces standard Docker image size from ~3.2 GiB to ~1.2 GiB

This PR does the following to reduce image size:

  1. Reduce .git directory size in final image
    • Performs in-place shallow clone by keeping only the HEAD commit and pruning unlinked objects
    • Drops .git repository pack files from 800 MiB to roughly 30 MiB
    • .git is kept as it (supposedly) is read at runtime in yacyBuild.properties:ReleaseStub (YaCy's Docker ReleaseStub is entirely broken. #566)
  2. Set CHMOD permissions during multi-stage copy
    • Docker BuildKit now supports --chmod and --chown parameters for the COPY function
    • The separate COPY and chown commands are now merged to avoid duplicating the 1 GiB /opt/yacy_search_server directory due to the permission changes
  3. Base Image for OS dependencies
    • An additional base image build stage was created to avoid re-installing common OS dependencies in appbuilder and final stages

@Orbiter
Copy link
Member

Orbiter commented May 6, 2024

I will look into it soon!

@Orbiter Orbiter merged commit 0405ec8 into yacy:master May 12, 2024
1 check passed
@Orbiter
Copy link
Member

Orbiter commented May 12, 2024

great work 👍 thank you!

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.

2 participants