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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Build a Container Image from Scratch

196 点作者 prakashdanish2 个月前

5 条评论

godelski大约 2 个月前
I often wonder, why isn&#x27;t systemd-nspawn[0] used more often? It&#x27;s self-described as &quot;chroot on steroids&quot;. IME it pretty much lives up to that name. Makes it really easy to containerize things and since it integrates well with systemd you basically don&#x27;t have to learn new things.<p>I totally get these are different tools and I don&#x27;t think nspawn makes docker or podman useless, but I do find it interesting that it isn&#x27;t more used, especially in things you&#x27;re using completely locally. Say, your random self-hosted server thing that isn&#x27;t escaping your LAN (e.g. Jellyfin or anything like this)<p>[0] <a href="https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;Systemd-nspawn" rel="nofollow">https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;Systemd-nspawn</a>
评论 #43430452 未加载
评论 #43433217 未加载
评论 #43435167 未加载
评论 #43436521 未加载
评论 #43433663 未加载
评论 #43430295 未加载
jmholla大约 2 个月前
If the author is here, I think there&#x27;s a typo in this. In section 1.4, you start working from the scratch layer, but the content continues to refer to alpine as the base layer.<p><pre><code> FROM scratch COPY .&#x2F;hello &#x2F;root&#x2F; ENTRYPOINT [&quot;.&#x2F;hello&quot;] </code></pre> &gt; Here, our image contains 2 layers. The first layer comes from the base image, the alpine official docker image i.e. the root filesystem with all the standard shell tools that come along with an alpine distribution. Almost every instruction inside a Containerfile generates another layer. So in the Containerfile above, the COPY instruction creates the second layer which includes filesystem changes to the layer before it. The change here is “adding” a new file—the hello binary—to the existing filesystem i.e. the alpine root filesystem.
评论 #43435061 未加载
评论 #43434566 未加载
mortar大约 2 个月前
Just learnt about whiteout files from this, thanks! Trying to understand if you purposely included a filename into a layer with the same whiteout prefix “.wh.”, if it would mess with the process that is meant to obfuscate that prefix from subsequent layers.
评论 #43429777 未加载
DeathArrow大约 2 个月前
By containers here the author seems to understand Docker containers. But there are other types of containers like Linux&#x2F;OpenVZ containers, Windows containers etc.
评论 #43434209 未加载
评论 #43435144 未加载
tmaly大约 2 个月前
Is there a windows version ?
评论 #43429843 未加载
评论 #43433114 未加载
评论 #43438551 未加载