Dockerizing a shell script?
How I reduced the size of my very first published docker image by 40% - A lesson in dockerizing shell scripts
Submitted 8 months ago by bugsmith@programming.dev to programming@programming.dev
https://bhupesh.me/publishing-my-first-ever-dockerfile-optimization-ugit/
Comments
MonkderZweite@feddit.ch 8 months ago
otl@lemmy.sdf.org 8 months ago
The art of turning a 500-line text file into a 50MB tarball. Welcome to the future :(
dataprolet@lemmy.dbzer0.com 8 months ago
Yeah, wtf, why would you do that?
domi@lemmy.secnd.me 8 months ago
Environments like Kubernetes only run containers so you would deploy any shell script with containers as well.
ikidd@lemmy.world 8 months ago
So you know what your dependencies are.
Carighan@lemmy.world 8 months ago
17+ MB for a shell script.
Then asks:
Could we reduce the size further
No. No certainly not. I would see no way to make a 500 lines text file use less than 17 MB of space.
amju_wolf@pawb.social 8 months ago
This is cool but it’ll be a nightmare to update.
Also, chances are that if you use Alpine the person using your image already has the base layer downloaded, so your image might actually be “bigger” for most people.
eluvatar@programming.dev 8 months ago
Yeah in a PR I would probably reject this for being too clever. Before clicking I expected the image to start at 100mb or more, but it’s already under 50, who cares at this point?
AnarchistArtificer@slrpnk.net 8 months ago
Man, “too clever” is a phrase that always throws me for a loop, even though I understand what is meant by it; over the years, as I grow wiser, I learn to be less clever. Still weird to think of it this way though