Building Container Images
Public registries provide container images for most use cases but they might not cover all of them. That’s why container engines such as Podman & Docker and CLI tools like buildah provide utilities for creating custom container images. The build steps are written in a plaintext file called Containerfile and parsed by container engines (or buildah) during the build process. 1 2 3 4 5 6 7 8 # Containerfile FROM node:18-alpine LABEL version="1.0" WORKDIR /app COPY . . RUN yarn install --production CMD ["node", "src/index.js"] EXPOSE 3000 Containerfile Instructions Steps inside the containerfile are defined using instructions such as FROM, RUN, ADD, COPY, etc. Container Engines go through the containerfile line-by-line and perform each step, stacking a new image layer on top of the previous one. ...