Live data from Hacker News

A tiny Docker image to serve static websites

lipanski.com

1–10 of 156 posts

Re: A tiny Docker image to serve static websites

#2
I love stuff like this.

People will remark about how this is a waste of time, others will say it is absolutely necessary, even more will laud it just for the fun of doing it. I'm in the middle camp. I wish software/systems engineers would spend more time optomising for size and performance.

Re: A tiny Docker image to serve static websites

#3
post #2

I love stuff like this. People will remark about how this is a waste of time, others will say it is absolutely necessary, even more will laud it just for the fun of doing it. I'm in the middle camp. I wish software/systems engineers would spend more time optomising for size and performance.

The difference between a systems engineer and a software engineer is that to a systems engineer a half functioning 5MB docker image is okay but to a software engineer a fully functional 5GB Node image is fine.

Re: A tiny Docker image to serve static websites

#6
post #2

I love stuff like this. People will remark about how this is a waste of time, others will say it is absolutely necessary, even more will laud it just for the fun of doing it. I'm in the middle camp. I wish software/systems engineers would spend more time optomising for size and performance.

I think the real value is just focusing on the absolute minimum necessary software in a production docker/container image. It's a good practice for security with less surface area for attackers to target.

Re: A tiny Docker image to serve static websites

#7

But why would you prefer Docker like this over, for example, running thttpd directly? Saves you a lot of Ram an indirection?

Run this on a linux host and it isn't that much different from running thttpd directly. There's just some extra chroot, cgroups, etc. setup done before launching the process but none of that gets in the way once it's running. Docker adds a bit of networking complexity and isolation, but even that is easily disabled with a host network CLI flag.

It's really only on windows/mac where docker has significant memory overhead, and that's just because it has to run a little VM with a linux kernel. You'd have the same issue if you tried to run thttpd there too and couldn't find a native mac/windows binary.

Re: A tiny Docker image to serve static websites

#8
post #2

I love stuff like this. People will remark about how this is a waste of time, others will say it is absolutely necessary, even more will laud it just for the fun of doing it. I'm in the middle camp. I wish software/systems engineers would spend more time optomising for size and performance.

Wouldn't removing Docker entirely be a good optimization?

Re: A tiny Docker image to serve static websites

#9
post #8
post #2

I love stuff like this. People will remark about how this is a waste of time, others will say it is absolutely necessary, even more will laud it just for the fun of doing it. I'm in the middle camp. I wish software/systems engineers would spend more time optomising for size and performance.

Wouldn't removing Docker entirely be a good optimization?

Docker adds other value to the lifecycle of your deployment. An "optimization" where you're removing value is just a compromise. Otherwise we'd all run our static sites on UEFI.

Re: A tiny Docker image to serve static websites

#10
post #8

Earlier quoted context omitted.

Wouldn't removing Docker entirely be a good optimization?

Docker adds other value to the lifecycle of your deployment. An "optimization" where you're removing value is just a compromise. Otherwise we'd all run our static sites on UEFI.

This is a really good point, and something I think a lot of people forget. It's true, the most secure web app is one written with no code/no OS/does nothing.

Adding value is a compromise of some increased security risk - and it's our job to mitigate that as much as possible by writing quality software.

Post reply on HN