owenthereal / upterm

Instant Terminal Sharing
https://upterm.dev
Apache License 2.0
861 stars 56 forks source link

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

Closed bcspragu closed 9 months ago

bcspragu commented 9 months ago

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?

owenthereal commented 9 months ago

Thanks for the contribution!