Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Tag: Multi-Stage Builds

Docker

Docker: Fix a Multi-Stage Build Silently Reusing a Cached Layer From an Older Base Image Because the Tag Was Updated Without Changing Its Name

- 06.11.26 - ErcanOPAK comment on Docker: Fix a Multi-Stage Build Silently Reusing a Cached Layer From an Older Base Image Because the Tag Was Updated Without Changing Its Name

🐳 Docker: Fix a Multi-Stage Build Silently Reusing a Cached Layer From an Older Base Image Because the Tag Was Updated Without Changing Its Name Docker’s build cache keys a FROM instruction’s layer to the base image’s digest at the moment it was last pulled locally, not to whatever the tag currently points to on […]

Read More
Docker

Docker: Fix a Multi-Stage Build Copying an Empty Directory Because the Builder Stage Never Actually Produced the Expected Output Path

- 30.10.26 - ErcanOPAK comment on Docker: Fix a Multi-Stage Build Copying an Empty Directory Because the Builder Stage Never Actually Produced the Expected Output Path

🐳 Fix a Multi-Stage Build Copying an Empty Directory Because the Builder Stage Never Actually Produced the Expected Output Path `COPY –from=builder` only promises to copy whatever exists at that path in the builder stage — it has no concept of whether that directory is supposed to be non-empty. If the builder stage’s actual build […]

Read More
Docker

Docker: Fix a Multi-Stage Build That Silently Reuses a Stale Layer Because a COPY Instruction’s Source File Mtime Never Changed

- 21.10.26 - ErcanOPAK comment on Docker: Fix a Multi-Stage Build That Silently Reuses a Stale Layer Because a COPY Instruction’s Source File Mtime Never Changed

🐳 The Build That Keeps Shipping Yesterday’s File Docker’s build cache for a COPY instruction is keyed off the content and metadata of the files being copied, and in most setups that’s exactly what you want – but a build step driven by a CI pipeline that checks out a fresh clone, regenerates a file […]

Read More
Docker

Docker: Fix a Multi-Stage Build Cache That Never Invalidates Because a COPY Layer Hashes Identically Across Unrelated Commits

- 04.10.26 - ErcanOPAK comment on Docker: Fix a Multi-Stage Build Cache That Never Invalidates Because a COPY Layer Hashes Identically Across Unrelated Commits

🐳 The Cache That Thought Nothing Had Changed Docker’s build cache decides whether to reuse a layer by hashing the instruction and, for a COPY instruction, the content of the files being copied – which is normally exactly the right behavior, skipping real work when nothing relevant actually changed. A COPY instruction that copies an […]

Read More
Docker

Docker: Multi-Stage Builds for Optimized Images

- 17.08.26 - ErcanOPAK comment on Docker: Multi-Stage Builds for Optimized Images

📦 Multi-Stage Builds = Smaller Images Docker images can be huge. Multi-stage builds separate build and runtime environments, creating smaller, more secure images. 📝 Multi-Stage Dockerfile Examples # .NET Core Multi-Stage Build # Stage 1: Build FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src # Copy and restore dependencies COPY *.csproj . RUN dotnet restore # Copy […]

Read More
Docker

Docker: Optimize Images with Multi-Stage Builds

- 25.07.26 - ErcanOPAK comment on Docker: Optimize Images with Multi-Stage Builds

📦 Multi-Stage Builds = Smaller Images Docker images can be huge. Multi-stage builds separate build and runtime environments, creating smaller, more secure images. 📝 Multi-Stage Dockerfile Examples # .NET Core Multi-Stage Build # Stage 1: Build FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src # Copy and restore dependencies COPY *.csproj . RUN dotnet restore # Copy […]

Read More
Docker

Docker: Use Multi-Stage Builds to Reduce Image Size by 90%

- 26.05.26 - ErcanOPAK comment on Docker: Use Multi-Stage Builds to Reduce Image Size by 90%

📦 Tiny Production Images 1.5GB Docker image? Build tools in production? Security nightmare. Multi-stage builds create small, secure images. Only runtime files shipped. ❌ Single Stage (1.2GB) FROM node:18 WORKDIR /app COPY . . RUN npm install RUN npm run build CMD [“node”, “dist/server.js”] ✅ Multi-Stage (150MB) FROM node:18 AS builder WORKDIR /app COPY . […]

Read More
Docker

Docker: Use Multi-Stage Builds to Reduce Image Size by 90%

- 30.03.26 - ErcanOPAK comment on Docker: Use Multi-Stage Builds to Reduce Image Size by 90%

📦 Tiny Production Images 1.5GB Docker image? Build tools in production? Security nightmare. Multi-stage builds create small, secure images. Only runtime files shipped. The Problem: Bloated Images # ❌ Bad: Everything in one stage FROM node:18 WORKDIR /app # Install dependencies COPY package*.json ./ RUN npm install # Installs dev dependencies too! # Copy source […]

Read More
Docker

Docker Multi-Stage Builds: From 1.2GB to 50MB – A Production Story

- 23.02.26 | 23.02.26 - ErcanOPAK comment on Docker Multi-Stage Builds: From 1.2GB to 50MB – A Production Story

$ docker images | grep ‘before’ myapp:before 1.2GB “This is fine” 🔥 myapp:after 50MB “Wait, what?” 🤯 How we reduced our Docker image by 96% and cut deployment time from 10 minutes to 30 seconds. The Problem: Build Artifacts in Production ❌ The Bad Old Way FROM node:18 WORKDIR /app # Copy everything (including .git, […]

Read More
November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (981)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (858)
  • How to select distinct rows in a datatable in C# (854)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (653)
  • Add Constraint to SQL Table to ensure email contains @ (609)
  • Average of all values in a column that are not zero in SQL (570)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (547)
  • Find numbers with more than two decimal places in SQL (475)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit
  • SQL Server: Fix ROW_NUMBER Ties Reordering Between Identical Runs
  • C#: Fix an Enum HasFlag Returning True for the Zero Value
  • WordPress: Fix Featured Images Vanishing After a CDN Migration
  • Photoshop: Fix Content-Aware Fill Smearing a Repeating Pattern
  • Asp.Net Core: Fix Antiforgery Tokens Rejected Behind a Reverse Proxy

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (981)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (858)
  • How to select distinct rows in a datatable in C# (854)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com