Tech, ExplainedCloud platforms and developer tools
Part

Docker and container developer tools

The container built on a developer's laptop.

INSIDE: KUBERNETES PLATFORMHOW IT WORKS · A REMINDER SERVICE AT A HEALTH-TECH STARTUP IN CHANDIGARHThe developerwrites aDockerfilefor thereminder serviceThe build takes40 secondsand makes a180 MB imageShe runs it onher laptopbeside a testdatabasecontainerThe pipelinepushes version1.4.2 to theregistry;Kubernetesstarts 3 copiesAll 3 crash;in Lens shereads thelog: a missingsecret keyShe adds the keyto the testcluster, and all3 copies runALSO TALKS TOArtifact registry↗ DEVOPSCI/CD pipeline↗ DEVOPSINSIDE: KUBERNETES PLATFORMHOW IT WORKS · A REMINDER SERVICE AT A HEALTH-TECHSTARTUP IN CHANDIGARHThe developer writes aDockerfile for thereminder serviceThe build takes 40seconds and makes a 180MB imageShe runs it on herlaptop beside a testdatabase containerThe pipeline pushesversion 1.4.2 to theregistry; Kubernetesstarts 3 copiesAll 3 crash; in Lens shereads the log: a missingsecret keyShe adds the key to thetest cluster, and all 3copies runALSO TALKS TOArtifact registry↗ DEVOPSCI/CD pipeline↗ DEVOPSINSIDE: KUBERNETES PLATFORM · A REMINDERSERVICE AT A HEALTH-TECH STARTUP IN CHANDIGARHThe developer writes a Dockerfile for thereminder service↓The build takes 40 seconds and makes a180 MB image↓She runs it on her laptop beside a testdatabase container↓The pipeline pushes version 1.4.2 to theregistry; Kubernetes starts 3 copies↓All 3 crash; in Lens she reads the log: amissing secret key↓She adds the key to the test cluster, andall 3 copies runALSO TALKS TOArtifact registry↗ DEVOPSCI/CD pipeline↗ DEVOPS
Inside the Kubernetes platform, a developer builds a 180 MB image on her laptop, the pipeline pushes it to the registry, and Lens shows why its copies crash in the test cluster.
opens a page inside this one a page in the same scene a page in another scene a concept page a label only, with no page

Docker and container developer tools are the programs that developers use on their own laptops to pack an app into a container, run it, and look inside the clusters where containers run. Docker is the best-known tool for building containers. Desktop tools such as Lens let a developer see a running Kubernetes cluster in a window, instead of typing commands.

A container is a package that holds a piece of software with everything it needs to run: the code, the libraries and the settings. The stored package is called an image, and a running copy of an image is called a container. Because the package holds everything, the app runs the same way on the developer's laptop, on a test server and in production, the live system that customers use. This ends an old problem in software teams: "it worked on my machine".

How does a developer build one? She writes a short text file called a Dockerfile. It lists the steps: start from a small Linux base image, copy in the code, install the libraries, and name the command that starts the app. One command builds the image. Another runs it on the laptop. A third pushes the image to an artifact registry, a store of images from which servers can download them. In most companies, the push is done by the CI/CD pipeline, the automated system that builds and tests every change.

For instance, a developer at a health-tech startup in Chandigarh adds a feature that sends patients appointment reminders on WhatsApp. She writes a Dockerfile for the reminder service. The build takes 40 seconds and produces an image of 180 MB. She runs it on her laptop beside a test database, which also runs in a container, and sends herself a test reminder. Then she commits the code, which means saving the change to the company's code repository. The pipeline builds the same image, tests it, and pushes it to the registry as version 1.4.2. Kubernetes starts three copies in the test cluster. All three keep crashing and restarting. She opens Lens, clicks on one of the failing copies and reads its log. The service cannot find the secret key that it needs to call the messaging company's API, the fixed format through which one program sends requests to another. The key was set on her laptop, but not in the test cluster. She adds it, and all three copies run.

Is Docker the same as Kubernetes? No. Docker builds and runs containers on one machine. Kubernetes runs many containers across many machines, and decides which machine runs each one. Developers use Docker every day, while operations teams run the Kubernetes platform. Images built with Docker run on Kubernetes, because both follow the same open standard for container images.

The business side is unusual. Docker's core is open source and free. But since 2021, larger companies must pay for Docker Desktop, the app that developers install on their laptops.

Tech, Explained is a part of ingrid.fyi. Every page explains one piece of technology in plain words.