Wednesday, October 22, 2025

🐳 What Programming Languages Are Used to Build Docker and Kubernetes? — Languages, Architecture & Examples

What Programming Languages Are Used to Build Docker and Kubernetes? — Languages, Architecture & Examples

 πŸš€ Introduction

In the world of DevOps, Docker and Kubernetes are the backbone technologies that power containerization and orchestration.
But have you ever wondered — what languages were used to build these powerful tools?

Let’s explore the languages, architecture design, and see simple examples showing how these technologies work internally.


🐳 Docker — Built Primarily in Go (Golang)

🧠 Why Go (Golang)?

Docker was originally developed in Go, a language created by Google engineers.
Go provides:

  • High performance (compiled language)

  • Built-in concurrency (goroutines)

  • Fast compilation and low memory overhead

  • Excellent support for networking and system-level operations

These features make Go perfect for building a container runtime like Docker, which interacts directly with the Linux kernel.


🧩 Docker Architecture Overview

Docker is built with a client-server architecture:

  1. Docker Client — Written in Go; sends commands like docker run, docker build.

  2. Docker Daemon (dockerd) — Runs in the background, manages images, containers, and volumes.

  3. Docker Engine — The core service that builds and runs containers using low-level APIs.

  4. Container Runtime (runc) — Built using Go and C libraries; executes containers directly on the OS.


πŸ’» Sample Code in Go (Docker-like Example)

Below is a minimal Go example showing how Docker handles commands via HTTP APIs.

package main import ( "fmt" "net/http" ) func main() { http.HandleFunc("/run", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Running a new container!") }) fmt.Println("Docker-like API running on port 8080...") http.ListenAndServe(":8080", nil) }

Explanation:

  • This mimics how the Docker daemon listens for client requests on an API port.

  • The /run endpoint could later trigger a container execution command internally (in Docker, this is done via Go routines).


☸️ Kubernetes — Also Built Primarily in Go (Golang)

🧠 Why Kubernetes Uses Go?

Like Docker, Kubernetes (K8s) is also built in Go.
It was developed by Google engineers and donated to the Cloud Native Computing Foundation (CNCF).

Go’s concurrency model and strong networking capabilities make it ideal for managing large distributed clusters.


⚙️ Kubernetes Core Components (All Written in Go)

  1. kube-api-server — Central control plane component that exposes APIs.

  2. kube-scheduler — Assigns pods to nodes.

  3. kube-controller-manager — Ensures desired state (replicas, nodes, etc.).

  4. kubelet — Agent that runs on every node and communicates with API server.

  5. kubectl (CLI) — Command-line tool written in Go that interacts with Kubernetes API.


πŸ’» Sample Go Code (Kubernetes-like API)

Below is a Go example showing a simple simulation of a Kubernetes API server.

package main import ( "encoding/json" "net/http" ) type Pod struct { Name string `json:"name"` Image string `json:"image"` } func main() { http.HandleFunc("/api/pods", func(w http.ResponseWriter, r *http.Request) { pods := []Pod{ {"web-server", "nginx:latest"}, {"db-server", "mysql:8"}, } json.NewEncoder(w).Encode(pods) }) http.ListenAndServe(":8081", nil) }

Explanation:

  • The /api/pods endpoint mimics the Kubernetes API Server’s response.

  • It returns a JSON list of running “pods” — just like real K8s APIs do.


🧩 Other Supporting Languages Used

ComponentLanguagePurpose
Go (Golang)Docker Engine, Kubernetes coreMain logic, APIs, networking
C/C++Docker runtime (low-level Linux system calls)System-level process isolation
PythonTesting, build tools, CI/CD scriptsAutomation, plugins
Shell Scripts (Bash)Deployment scripts, setup scriptsInitialization and configuration

⚔️ Docker vs Kubernetes — Language and Function Comparison

FeatureDockerKubernetes
Primary LanguageGo (Golang)Go (Golang)
PurposeContainerization (build, ship, run containers)Orchestration (manage containers across clusters)
Low-Level LanguageSome C componentsPure Go
API LayerREST APIs in GoREST APIs in Go
CLI Tooldockerkubectl

πŸ” Summary

ToolDeveloped UsingMaintained ByKey Functionality
DockerGo, CDocker Inc.Build and run containers
KubernetesGoCNCFManage container clusters

Both Docker and Kubernetes share a common backbone — Golang, which ensures scalability, speed, and reliability for modern cloud-native systems.


πŸ’‘ Conclusion

Both Docker and Kubernetes revolutionized the DevOps ecosystem.
Their choice of Go language ensures they are fast, concurrent, and scalable, making them ideal for managing millions of containers in distributed environments.

Whether you are learning DevOps or building your own microservice orchestration platform, understanding Go’s role in these tools gives you an edge in mastering Cloud-Native development.

Tuesday, October 21, 2025

🧩 What Are Artifacts in Azure DevOps? (Complete Guide with Real-Time Examples)

 πŸš€ Introduction

In a CI/CD (Continuous Integration/Continuous Deployment) pipeline, build outputs like .dll, .exe, .zip, or .nupkg files need to be stored, shared, and used by later stages — such as testing or deployment.

These outputs are called Artifacts.

In Azure DevOps, Artifacts act as a bridge between the build and release pipelines, allowing teams to store, version, and distribute build outputs efficiently.


🧠 What is an Artifact in Azure DevOps?

An Artifact in Azure DevOps is any file or package produced during the build process that you want to save for later use — such as in deployment, testing, or distribution.

When a build pipeline completes, it can publish its output (e.g., binaries, reports, zip files) as Build Artifacts, which are then consumed by Release Pipelines or other stages.


⚙️ Types of Artifacts in Azure DevOps

Azure DevOps supports multiple types of artifacts:

1. Build Artifacts

  • Generated from a build pipeline.

  • Used to transfer build outputs to a release pipeline.

  • Example: Compiled .dll files, web app .zip, test reports, etc.

2. Pipeline Artifacts

  • Newer, faster, and more efficient than legacy build artifacts.

  • Stored in Azure DevOps and linked directly to the pipeline run.

  • Supports caching and is optimized for large files.

3. Azure Artifacts (Package Feeds)

  • A package management system integrated into Azure DevOps.

  • Supports NuGet, npm, Maven, Python, and Universal Packages.

  • Helps developers share libraries or dependencies across projects.


πŸ’‘ Real-Time Example: Build to Release Flow

Let’s imagine a .NET Core web application that’s being built and deployed using Azure DevOps.

πŸ”Ή Step 1: Build Pipeline

The build pipeline compiles the code, runs tests, and creates a .zip file for deployment.

- task: DotNetCoreCLI@2 inputs: command: 'publish' publishWebProjects: true arguments: '--configuration Release --output $(Build.ArtifactStagingDirectory)' - task: PublishBuildArtifacts@1 inputs: pathToPublish: '$(Build.ArtifactStagingDirectory)' artifactName: 'WebAppBuild'

πŸ‘‰ This will generate and store the build output as an artifact named “WebAppBuild”.


πŸ”Ή Step 2: Release Pipeline

The release pipeline picks up the published artifact (WebAppBuild.zip) and deploys it to Azure App Service.

- stage: Deploy jobs: - deployment: DeployWebApp environment: 'Production' strategy: runOnce: deploy: steps: - download: current artifact: WebAppBuild - task: AzureWebApp@1 inputs: azureSubscription: 'MyAzureConnection' appName: 'mywebapp-prod' package: '$(Pipeline.Workspace)/WebAppBuild/*.zip'

✅ The artifact acts as the connector between Build and Release pipelines, ensuring the exact build output gets deployed.


πŸ“¦ Azure Artifacts Feed Example

If you are building reusable libraries or packages, you can publish them to Azure Artifacts Feed instead of external sources.

Example: Publishing a NuGet Package.

- task: DotNetCoreCLI@2 inputs: command: 'pack' packagesToPack: '**/*.csproj' versioningScheme: 'off' - task: NuGetCommand@2 inputs: command: 'push' packagesToPush: '**/*.nupkg' publishVstsFeed: 'MyCompanyFeed'

✅ The .nupkg files will be published to your private Azure Artifacts feed, where developers can reuse them across multiple solutions.


πŸ” Why Artifacts Are Important

BenefitDescription
ConsistencyEnsures the same build output is used across test, staging, and production environments.
VersioningEach artifact is tied to a specific pipeline run and build version.
ReusabilityShared components or libraries can be reused via Azure Artifacts feed.
TraceabilityEasy to track which build version was deployed where.
AutomationSimplifies the flow between CI (build) and CD (release).

🧩 Difference Between Build Artifacts and Azure Artifacts Feed

FeatureBuild/Pipeline ArtifactsAzure Artifacts Feed
PurposeStore build outputsManage reusable packages
UsageUsed between build and releaseUsed across multiple projects
Example.zip, .dll, .exe.nupkg, .npm, .jar
RetentionShort-term storage (build-related)Long-term package management
IntegrationCI/CD pipelinesDeveloper environment & pipelines

🏁 Summary

  • Artifacts in Azure DevOps represent the output of a build or reusable package for other stages in a pipeline.

  • They enable smooth transitions between CI and CD stages, ensuring consistent and reliable deployments.

  • Use Build/Pipeline Artifacts for deployment packages, and Azure Artifacts Feeds for library sharing and dependency management.

Don't Copy

Protected by Copyscape Online Plagiarism Checker

Pages