Cloud Native 6 min read

Docker ‘Create Something from Nothing’: Building .NET Core Apps Without Local SDKs

This article demonstrates how Docker can be used to compile and publish a .NET Core application without installing any SDKs locally, by leveraging a docker‑compose CI build file, explaining the steps, underlying mechanisms, and broader benefits for clean CI environments and shared resources.

DevOps
DevOps
DevOps
Docker ‘Create Something from Nothing’: Building .NET Core Apps Without Local SDKs

During the Three Kingdoms era (220‑280 AD) strategies were crucial for dominance, just as modern IT seeks powerful tactics to boost delivery efficiency.

In 2013, DevOps gained momentum and Docker emerged as a transformative technology that quickly spread worldwide, offering a way to dramatically improve deployment speed.

Docker "Create Something from Nothing" is the first of these strategic tips, inspired by the Lao‑zi saying “All things are born of being, being is born of non‑being”.

By using the provided GitHub repository https://github.com/ups216/netcore-docker-example , you can compile and debug .NET Core code without any SDK installed on the host.

Below is the docker-compose.ci.build.yml file that defines the CI build process:

version: '2' services: ci-build: image: microsoft/aspnetcore-build:1.0-1.1 volumes: - .:/src working_dir: /src command: /bin/bash -c "dotnet restore ./netcore-docker-example.sln && dotnet publish ./netcore-docker-example.sln -c Release -o ./obj/Docker/publish"

Run the build with a single command (no other software required besides Docker):

docker-compose -f docker-compose.ci.build.yml up

The command performs three actions:

Pulls the microsoft/aspnetcore-build:1.0-1.1 image from Docker Hub and starts a container.

Mounts the current directory into the container at /src .

Executes dotnet restore and dotnet publish inside the container to compile and package the application.

Inside the container, the pre‑installed SDKs (dotnet, node, npm, bower, etc.) enable a clean, isolated build environment, eliminating the need for any local development tools.

This is the “create something from nothing” technique.

Beyond this example, Docker’s ability to provision clean environments on demand enables many scenarios, such as:

Setting up lightweight, reproducible CI pipelines without maintaining multiple VM images for different languages or versions.

Sharing a single build environment across multiple projects, reducing resource consumption and increasing utilization.

Previous Docker4Dev articles cover topics like Windows containers, Azure registry, VSTS/TFS pipelines, and macOS development with VS Code.

DockerCI/CDDevOpsContainerization.NET Coreaspnetcore
DevOps
Written by

DevOps

Share premium content and events on trends, applications, and practices in development efficiency, AI and related technologies. The IDCF International DevOps Coach Federation trains end‑to‑end development‑efficiency talent, linking high‑performance organizations and individuals to achieve excellence.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.