TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Haskell Web Server in a 5MB Docker Image

65 点作者 lubomir大约 10 年前

4 条评论

cies大约 10 年前
I was looking into some of this myself already; really helpful article and amazing results. Another interesting approach is to compile Haskell with HaLVM[1] in to a unikernel that can run on a Xen hypervisor. But this is a non-posix environment on which Haskell&#x27;s &quot;network&quot; package does not compile. No &quot;network&quot; means that it is currently impossible[2] for WAI (Haskell&#x27;s standard interface between web servers and applications), but also db libraries, to run in such an environment.<p>With going unikernel with Haskell still being a little steep (but definitely on my wish list), then the next-best would be a mini VM&#x2F;container image. And 5MB sure is mini!<p>Once again, thanks FPComplete!<p>1: <a href="https:&#x2F;&#x2F;github.com&#x2F;GaloisInc&#x2F;HaLVM" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;GaloisInc&#x2F;HaLVM</a><p>2: <a href="https:&#x2F;&#x2F;github.com&#x2F;GaloisInc&#x2F;HaLVM&#x2F;issues&#x2F;43" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;GaloisInc&#x2F;HaLVM&#x2F;issues&#x2F;43</a>
评论 #9500956 未加载
chanux大约 10 年前
I was once fascinated by tiny docker images and wanted to have a tiny docker image with a web server.<p>There was a go web server I dockerized and came under 5MB [1]. But the thttpd image by larsks was an amazing 1MB [2].<p>[1] <a href="https:&#x2F;&#x2F;registry.hub.docker.com&#x2F;u&#x2F;chanux&#x2F;muhttpd&#x2F;" rel="nofollow">https:&#x2F;&#x2F;registry.hub.docker.com&#x2F;u&#x2F;chanux&#x2F;muhttpd&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;registry.hub.docker.com&#x2F;u&#x2F;larsks&#x2F;thttpd&#x2F;" rel="nofollow">https:&#x2F;&#x2F;registry.hub.docker.com&#x2F;u&#x2F;larsks&#x2F;thttpd&#x2F;</a>
joeyh大约 10 年前
I use the same technique of bundling the necessary dynamic libraries and gconv files for the git-annex standalone tarball distribution. I&#x27;ve observed users untarring that onto arbitrary wacky NAS boxes and it just working, which is pretty nice.<p>I later adapted that for use in propellor too, when it&#x27;s deploying docker&#x2F;etc containers. This allows propellor to bootstrap itself to run inside an arbitrary docker container. <a href="http:&#x2F;&#x2F;joeyh.name&#x2F;blog&#x2F;entry&#x2F;propelling_containers&#x2F;" rel="nofollow">http:&#x2F;&#x2F;joeyh.name&#x2F;blog&#x2F;entry&#x2F;propelling_containers&#x2F;</a><p>Later, I used propellor&#x27;s ability to bootstrap itself this way to let it copy itself onto a VM and run there to replace its content with a clean reinstall of Debian. <a href="http:&#x2F;&#x2F;joeyh.name&#x2F;blog&#x2F;entry&#x2F;clean_OS_reinstalls_with_propellor&#x2F;" rel="nofollow">http:&#x2F;&#x2F;joeyh.name&#x2F;blog&#x2F;entry&#x2F;clean_OS_reinstalls_with_propel...</a>
thu大约 10 年前
Oh I was following the same path and was mising a library or two. The result is similar to Michael&#x27;s scratch image: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;noteed&#x2F;4155ffad2b1d13ab17ee" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;noteed&#x2F;4155ffad2b1d13ab17ee</a><p>The resulting image for &quot;hello world&quot; compressed with `xz` (default options) is 1.5MB. And it runs in a chroot or with qemu too.