Skip to content

ADR: Linux over Windows

ADR: Linux containers over Windows

Status: accepted in practice since the first image; written down 2026-09-01.

In plain words

The site's container runs on Linux even though the app is built on a Windows machine. Nothing in the app needs Windows, and the Linux image is a fraction of the size of a Windows one.

What that is worth: a developer gets one image that runs the same on the laptop as in production, and the organization moved the site to a new host without changing the build file (Dockerfile).

Context

The application is built on a Windows machine, so Windows containers were the default-looking choice. The Dockerfile went Linux instead: a node:22-alpine build stage and the aspnet:10.0 Linux runtime. A week of shipping has turned that instinct into reasons.

Decision

Linux containers, everywhere the image runs.

The reasons, as learned

  • .NET 10 is fully cross-platform. Nothing in this application touches a Windows API, so Windows in the runtime would carry cost without buying anything.
  • Size is a tax paid on every push and every pull. The Linux runtime image keeps the whole application under a few hundred megabytes; Windows base images are gigabytes before the first line of app code arrives. This registry gets fed over a home connection, and the container group pulls the image on every roll.
  • The identity design requires it. The registry pull rides a user-assigned managed identity, and that capability belongs to Linux container groups on Azure Container Instances; Microsoft's own Q&A is a trail of Windows container groups failing at exactly this.
  • The hardening came free. The Linux aspnet image ships a built-in non-root user, and the healthcheck is one curl line.
  • One image works everywhere it needs to: Docker Desktop runs it on the Windows dev machine through WSL2, GitHub's ubuntu runners will build it in CI, and ACI runs it in production. Same bytes, three hosts.

Consequences

  • The dev machine needed WSL2, installed on provisioning day, a one-time cost.
  • Anything Windows-specific that creeps into the runtime is refused by the container. That constraint is a feature.

Addendum, 2026-09-20: the same image, on a different host

Superseded in part on 2026-09-20, as 1.0.0.156: the image no longer runs on Container Instances. Both sites are web apps for containers on one Linux App Service plan (ADR: One plan, two sites). The decision stands and did its job again: the same Linux image moved hosts with no change to the Dockerfile, which is the reason the first record gives for having a container at all. One of the reasons above moved with it. The registry pull still rides the user-assigned identity, and on App Service that is two properties on the site, acrUseManagedIdentityCreds and the identity's client id, rather than a capability of Linux container groups.

Where it sits

No ring: choosing Linux for the container is a hosting decision about the base images, and the code's layering and SOLID are untouched by it.

Files

# Stage 3: final runtime image.
FROM mcr.microsoft.com/dotnet/aspnet:11.0 AS runtime
# The runtime image is the correct final stage for a production container because it does not include the SDK or compilers.
WORKDIR /app

# Install curl so the runtime can run a real HTTP healthcheck without pulling in the SDK image.
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*

# The aspnet base image ships a built-in non-root user named 'app' (APP_UID) for exactly this purpose;
# creating another one collides with it, so the built-in user is used instead.
# The published app and static frontend content need to be owned by the runtime user.
COPY --chown=app:app --from=api-publish /app/publish/ /app/
# The API reads project docs and the dataset from the repo root at runtime, so they must be present in the container.
COPY --chown=app:app README.md ./
COPY --chown=app:app docs ./docs
COPY --chown=app:app data ./data
COPY --chown=app:app infra ./infra
# Live code samples (ADR-014): the docs endpoints read these at request time. Sources only;
# wwwroot and the photo set already arrive through the publish above.
COPY --chown=app:app src ./src
COPY --chown=app:app .github/workflows ./.github/workflows
# The quality scanner, whose ratchet block ADR-122 shows live.
COPY --chown=app:app .github/quality.py ./.github/
# The ratchet's limits, which the Quality page shows whole (ADR-130).
COPY --chown=app:app .github/quality-ratchet.json ./.github/
# CodeRabbit's configuration, whose level ADR-129 shows live.
COPY --chown=app:app .coderabbit.yaml ./
COPY --chown=app:app .vscode ./.vscode
COPY --chown=app:app api/TheYard.slnx ./api/
COPY --chown=app:app api/TheYard.Api/*.cs api/TheYard.Api/*.csproj ./api/TheYard.Api/
COPY --chown=app:app api/TheYard.Api/Shared ./api/TheYard.Api/Shared
COPY --chown=app:app api/TheYard.Api/Features ./api/TheYard.Api/Features
COPY --chown=app:app api/TheYard.Application/*.csproj ./api/TheYard.Application/
COPY --chown=app:app api/TheYard.Application/Features ./api/TheYard.Application/Features
COPY --chown=app:app api/TheYard.Application/Shared ./api/TheYard.Application/Shared
COPY --chown=app:app api/TheYard.Data/*.cs api/TheYard.Data/*.csproj ./api/TheYard.Data/
COPY --chown=app:app api/TheYard.Domain/*.csproj ./api/TheYard.Domain/
COPY --chown=app:app api/TheYard.Domain/Features ./api/TheYard.Domain/Features
COPY --chown=app:app api/TheYard.Domain/Shared ./api/TheYard.Domain/Shared
COPY --chown=app:app api/TheYard.Infrastructure/*.cs api/TheYard.Infrastructure/*.csproj ./api/TheYard.Infrastructure/
COPY --chown=app:app api/TheYard.Infrastructure/Features ./api/TheYard.Infrastructure/Features
COPY --chown=app:app api/TheYard.Infrastructure/Shared ./api/TheYard.Infrastructure/Shared
COPY --chown=app:app api/TheYard.Infrastructure.Cosmos/*.csproj ./api/TheYard.Infrastructure.Cosmos/
COPY --chown=app:app api/TheYard.Infrastructure.Cosmos/Features ./api/TheYard.Infrastructure.Cosmos/Features
COPY --chown=app:app api/TheYard.Infrastructure.Cosmos/Shared ./api/TheYard.Infrastructure.Cosmos/Shared
COPY --chown=app:app api/TheYard.Experiment/*.cs api/TheYard.Experiment/*.csproj ./api/TheYard.Experiment/
COPY --chown=app:app api/TheYard.Migrations.Sqlite/*.cs api/TheYard.Migrations.Sqlite/*.csproj ./api/TheYard.Migrations.Sqlite/
# The job hunt Function's sources, so the nightly card reads each process's summary from the code at this version (ADR-109).
COPY --chown=app:app functions/jobhunt/*.cs ./functions/jobhunt/
# The job hunt Function's test classes by name: the Quality page's rule counts leave a Function rule's tests out of the
# site's results by these names, read when the page is served (QualityCounts.cs).
COPY --chown=app:app functions/jobhunt.Tests ./functions/jobhunt.Tests
# The archive job's slice, so its record shows the code that zips, checks and moves (ADR: Old folders are zipped, not kept).
COPY --chown=app:app server/JobHunt.Server.Application/Features/Archive ./server/JobHunt.Server.Application/Features/Archive
# The DDL, so the records can show the schema they describe (ADR-014).
COPY --chown=app:app api/TheYard.Database ./api/TheYard.Database
COPY --chown=app:app api/TheYard.Tests/*.cs api/TheYard.Tests/*.csproj ./api/TheYard.Tests/
# The rest of what the records show live (ADR-017, the references pass): the edge,
# the end-to-end specs, and the root files the build and the tests are configured by.
COPY --chown=app:app Dockerfile netlify.toml playwright.config.ts vite.config.ts package.json index.html tsconfig.json tsconfig.app.json tsconfig.node.json .editorconfig ./
COPY --chown=app:app edge ./edge
COPY --chown=app:app tests ./tests
# The measuring script and the dataset tooling, shown by the records that used them (ADR-014, the
# coverage addendum): a live block can only show a file that is in the image, and a test holds this
# list to every path the documents name.
COPY --chown=app:app scripts ./scripts
COPY --chown=app:app render ./render
# One file from the sample beside this app: its architecture tests, which the onion practices page
# shows whole. Only that file here, because the rest of the sample is The Shed's own folder below.
COPY --chown=app:app samples/theshed/tests/TestProject.Tests/OnionTests.cs ./samples/theshed/tests/TestProject.Tests/
# The Shed's published folder, which Composition/ShedMount.cs starts The Shed from: its documents, its
# sample home, its page and the source files its live samples read, at the path Shed__ContentRoot names.
# Its own appsettings.json and README.md live there and nowhere near this app's.
COPY --chown=app:app --from=api-publish /app/shed/ /app/shed/
# The built frontend bundle is copied into wwwroot so the ASP.NET API can serve it and provide SPA fallback routing.
COPY --chown=app:app --from=frontend-build /src/dist/ /app/wwwroot/

# Build provenance, baked in at image build so the running container can report
# exactly which build it is. The API serves these at /api/version and the page
# footer renders them; the ship pipeline passes both arguments (ADR-005).
# #region build-args
# Provenance, baked in at build time: the running container can then tell you
# exactly which version and commit it is (the page footer and /api/version read
# these). Defaults keep a local `docker build` working without arguments.
ARG APP_VERSION=dev
ARG APP_COMMIT=local
ENV APP_VERSION=${APP_VERSION}
ENV APP_COMMIT=${APP_COMMIT}
# The Shed's footer names the commit too, and it is the same commit: one repository, one image.
ENV SHED_COMMIT=${APP_COMMIT}
ENV Shed__ContentRoot=/app/shed
# #endregion build-args

# Set the runtime URL to port 8080, which matches the container runtime conventions we want for a single-process app.
ENV ASPNETCORE_URLS=http://+:8080
# Expose the application port so orchestrators and humans know which port to publish and probe.
EXPOSE 8080

# Healthcheck against a real API endpoint to confirm the app is accepting traffic, not just that the process is alive.
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 CMD curl -fsS http://localhost:8080/healthz || exit 1

# Somewhere for the runtime user to write (ADR: The relational store). /app
# itself is created by WORKDIR and owned by root, so the SQLite file gets a
# directory of its own that the app user owns. Nothing is mounted here: the
# database lives and dies with the container, which the record is explicit
# about, and which is why the catalogue is seeded on every first boot.
RUN mkdir -p /app/state && chown app:app /app/state
ENV ConnectionStrings__Yard="Data Source=/app/state/yard.db"

# Run as a non-root user to reduce attack surface and comply with container hardening best practices.
USER app

# Start the hosted API; it serves both the API endpoints and the SPA shell.
ENTRYPOINT ["dotnet", "TheYard.Api.dll"]

Live from Dockerfile, region runtime, read from this build at 99df7a8.

Addendum, 2026-10-03: the build stage is Node 24

The build stage moved from node:22-alpine to node:24-alpine, and CI from Node 22 to Node 24, because 22 is in maintenance and 24 is the active long-term release (ADR: Technology versions). Nothing else in the stage changed.

Enforced by

Not machine-checked. Held by review.

Store

The Yard, home

Steven StoutStaff .NET engineerRemote

Production .NET that stays up. Built with AI, measured on every version.

Steven Stout

Hi, I'm Steve. I build the systems that make delivery boring in the best way, then coach people inside them.

  • 200+

    production releases, none took the platform down

    Conway Investment Research, 2019 to 2024. Sole engineer for the first three years on a live financial advisory platform.

    See how
  • 50%

    shorter release cycle

    Storee Construction, 2024 to 2026. Four ASP.NET applications onto one .NET 10 platform on Azure, with a four-person team I hired and mentored.

    See how

01Verified

Steven Stout

A real person, and the work is mine.

  • Identity

    Checked by LinkedIn, not by me.

    LinkedIn verified my government ID.

  • Running system

    You are looking at it.

    Version 1.0.5.273 is live. Nothing ships unless it passes the automated gates first.

That's who I am. Here's how I work.

02Strengths

Ten strengths, each with the proof beside it. The numbers match my resume and LinkedIn, and the live ones are read from this site as you look.

  • 01

    Keeps production alive

    200+ releases on a live financial platform, and none took it down. Sole engineer for the first three years.

    See the Conway work

  • 02

    Simplifies messy systems

    Four ASP.NET applications onto one .NET 10 platform on Azure, and a release cycle 50% shorter.

    See the Storee work

  • 03

    Marries dev and infrastructure

    Blue-green releases at Storee that flipped in about 5 seconds with nobody signed out, and Azure Front Door at two employers.

    See this site's cloud

  • 04

    Designs data that holds up

    White-label clients on one shared database, the isolation built into the data, and no cross-client issues.

    See the Conway work

  • 05

    Keeps AI-written code honest

    15 quality numbers that may only improve: 273 releases in a row with none worse.

    See the quality numbers

  • 06

    Resourceful

    $30,000+ cut from Azure and vendor spend at Conway. This site's Azure bill is public, resource by resource.

    See the bill

  • 07

    Builds people up

    Hired and mentored a four-person team. 13 colleagues recommend me by name.

    Read the recommendations

  • 08

    Takes ideas to production

    This site: designed, built and run solo, with 352 versions measured through one gate.

    How it was built

  • 09

    Writes clearly

    Posts on real engineering problems, in plain words.

    Read the blog

  • 10

    Owns decisions

    153 decision records, each with its tradeoff and the call I made.

    See the decision records

Built with AI. Gated so quality never slides.

Steven Stout’s showcase: a used-vehicle auction on .NET and React, built and run by one engineer, live on Azure, with its decisions written down.

No quality number has gotten worse at any release since 1.0.5.1 on 10 November: 273 releases in a row.

One engineer, an AI agent and a gate that checks 15 quality numbers on every release. 352 versions measured, with every result public, the worst days included.

82 releases in the last 7 days, each through the same gate.

Async methods with no CancellationToken, may only fall

11091.0.3.1391.0.5.2731.0.4.115, the ratchet
Every number, on the Quality page

TheYard, right nowLive

Answering in

unread

02505007501,000

server time at p95, the usual five minutes of the last day.

Azure this month

unread

the bill, by resource, read from Azure. The Admin tab shows every line.

Since the last roll

unread

 

rolled in place by the pipeline, behind one gate.

People who have visited

unread

30 days agotoday

Scanners, my own tools' and my own reads left out.

03Start here

04Where teams are heading

How I see engineering with AI, and the setup on this site that backs it.

AI-augmented teams · Architecture and ownership

AI writes more of the code. Someone still has to own what ships.

Teams are going to be heavily AI-augmented. That moves the senior job toward architecture and technical ownership: deciding what to build in pieces small enough to verify, and owning what ships.

  • Task tracking will get automated too. Judgment stays human: seeing a design fail at scale before it does.
  • On this site the AI's first design held the whole catalogue in memory. I caught it when the App Service plan hit 82 per cent and moved the work to the store.

What the AI wrote, what I decided

07Tech stack

  •    
  •    
  •    

Read from the build, never typed by hand

What TheYard runs on

What we use, where it runs, its AWS twin, the version as built, and the file that proves it.

Cloud patterns, not one vendor: every Azure piece in this stack has a named AWS twin. Mapped, not yet run on AWS.

  • .NET 1114 projects
  • React 19.3TypeScript 7.0
  • Azure9 Bicep files
  • 11GitHub Actions workflows
The whole stack, with the file that proves each line

The last release the gate stopped was 1.0.5.258 on 2 December, at its browser 1 of 2 job.

08How it is built

09How it is run

10Who and why

Next step

11What has to work, where is it today, and what does success look like?

Book 20 minutes opens an email to me with those three questions in it, and I answer with a time.

Book 20 minutes

Your email app should have opened with this message. If it did not, copy it and send it from any mailbox.

Or message me on LinkedIn