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

Shrink uptermd Docker image by 5 MB, 20% #225

Merged
merged 2 commits into from Feb 3, 2024

Conversation

bcspragu
Copy link
Contributor

@bcspragu bcspragu commented Feb 3, 2024

This PR bases the output Docker image on SCRATCH instead of alpine. Alpine is a great base, but for statically linked Go apps, we don't even need that.

I'm currently self-hosting using this updated image, it works identically as far as I can tell (e.g. no permission issues from the noroot user).

Sizes were calculated as:

# Build at current head
docker build -f Dockerfile.uptermd -t uptermd .
docker save uptermd -o uptermd.tar

# Checkout this PR
docker build -f Dockerfile.uptermd -t uptermd-new .
docker save uptermd-new -o uptermd-new.tar

uptermd.tar is ~26 MB, uptermd-new.tar is 21 MB.

The 5 MB isn't really that important when the image is already only 26 MB (as compared to some enormous Docker image people sling around), but I figured, why not?

The output `.tar` is 21M, need to see how that compares to the existing one
@owenthereal
Copy link
Owner

Thanks for the contribution!

@owenthereal owenthereal merged commit bb763d6 into owenthereal:master Feb 3, 2024
8 checks passed
owenthereal added a commit that referenced this pull request Feb 3, 2024
owenthereal added a commit that referenced this pull request Feb 3, 2024
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.

None yet

2 participants