Working with Docker
メモ
コンテナビルド時、reflinkやハードリンクをDockerコンテナとホストファイルシステムの間で作ることはできません。 次善の策は、BuildKit キャッシュ マウントを使用してビルド間でキャッシュを共有することです。 あるいは、 podman を使用することもできます。これは、ビルド時に Btrfs ボリュームをマウントできるためです。
Docker のイメージ・サイズとビルド時間の最小化
- 小さいイメージを使用します。例えば、 
node:XX-slim - 可能で合理的であれば、マルチステージを活用します。
 - BuildKit キャッシュ・マウントを利用します。
 
Example 1: Build a bundle in a Docker container
Since devDependencies is only necessary for building the bundle, pnpm install --prod will be a separate stage from pnpm install and pnpm run build, allowing the final stage to copy only necessary files from the earlier stages, minimizing the size of the final image.
.dockerignore
node_modules
.git
.gitignore
*.md
dist