Interactive Dockerfile Studio & Layer Cache Builder
Total Image Layers6 Layers
Final Compressed Size82 MB
Multi-Stage Slim Savings93% Smaller (1140MB ➔ 82MB)
DockerfileRead-only template
# Stage 1: Build Dependencies FROM node:22-alpine AS builder WORKDIR /app COPY package*.json ./ RUN npm ci --only=production # Stage 2: Production Minimal Runtime FROM node:22-alpine WORKDIR /app ENV NODE_ENV=production COPY --from=builder /app/node_modules ./node_modules COPY . . EXPOSE 3000 USER node CMD ["node", "server.js"]
Simulate Developer Code Change:
Layer Assembly & Cache StatusBase ➔ Top Layer
1
FROM node:22-alpineMinimal Alpine-based distribution (~5MB core OS + Node runtime).
REBUILD52 MB
2
WORKDIR /appCreates and sets execution context to /app.
REBUILD0 MB (Metadata)
3
COPY package*.json ./Copied separately to leverage layer cache when source code changes.
REBUILD0.1 MB
4
RUN npm ci --only=productionDeterministic install of only runtime packages.
REBUILD24 MB
5
COPY . .Fast layer rebuilt only when application code changes.
REBUILD5.9 MB
6
USER node & CMDRuns as non-root user for enterprise container security.
REBUILD0 MB (Metadata)
Docker Terminalv27.1
$docker version8:41:44 PM
Client: Docker Engine - Community v27.1.1 Server: Docker Engine - Simulated In-Browser Runtime (Safe Sandbox) Storage Driver: overlay2 (Virtual Layers) Status: Ready • Zero Docker Desktop Required
$