New releasev0.9.5Jul 14, 2026

New version of Boost releasedNew filters and bundled report dashboard

JFrog CI Labs
Docker Optimization

Docker Build: Use Multi-Stage Builds

0% faster
based on 3 test repositories

A single-stage Dockerfile bundles compilers, build tools, dev dependencies, and source code into the final image. Multi-stage builds split this into a builder stage that compiles your app and a minimal runtime stage that copies only the production artifact. The result: smaller images, faster pushes, tighter security surface, and significantly shorter CI build times.

Tested across 3 repositoriesData collected daily

How It Works

A monolithic Dockerfile ships compilers, dev tools, and source alongside your app. Multi-stage builds isolate the build environment, copying only the production artifact into a minimal runtime image.

Dockerfile
1FROM node:20
2WORKDIR /app
3COPY package*.json ./
4RUN npm ci
5COPY . .
6RUN npm run build
7RUN npm run test
8EXPOSE 3000
9CMD ["node", "dist/server.js"]
Final image1.2 GB

Includes build tools, dev deps, source maps

Build time~3m 05s

Full dependency install + build in single layer

Attack surfaceHigh

gcc, make, python, npm dev packages all present