Running Containers with docker run and kubectl
Run nginx:alpine first with docker run then with kubectl run on the same VM, and see how Kubernetes maps onto Docker concepts.

Lab overview
Most engineers meet Docker years before they meet Kubernetes, and by the time the cluster shows up the vocabulary feels alien: pods, manifests, services, controllers, kubelets. The reality is much simpler. Kubernetes runs the same OCI containers Docker does, fetched from the same image registries, with the same nginx:alpine bytes on disk. What Kubernetes adds is a scheduler that decides where containers run, a control loop that keeps them running, and a manifest format that describes the desired state instead of typing imperative flags. Everything else is a vocabulary swap.
The cleanest way to internalize that swap is to run the exact same workload twice on the exact same machine, once with docker run and once with kubectl run, and watch the verbs change while the container stays identical. In this lab, you will start a single nginx container with Docker, inspect it, and reach it through a published host port. You will then run the same nginx:alpine image as a bare Pod in a single-node kind cluster, reach it through kubectl port-forward, and reveal the implicit Pod manifest with --dry-run=client -o yaml. By the end, you will have filled in a Docker-to-Kubernetes verb map you wrote yourself, and the rest of the Kubernetes curriculum will read like a familiar language with new grammar.
Objectives
By completing this beginner lab, you will be able to:
- Run
nginx:alpineas a standalone Docker container and reach it from the host via a published port. - Run the same
nginx:alpineimage as a bare Pod in a kind cluster usingkubectl run. - Use
kubectl port-forwardto reach a Pod from the host and explain why it is needed instead of-p. - Generate a Pod manifest with
kubectl run --dry-run=client -o yamland identify the fieldsdocker runwas setting implicitly. - Compare lifecycle ownership for a Docker container versus a bare Pod and recognize when each is recreated by something else.
- Map common Docker verbs (
run,ps,logs,exec,rm) to their Kubernetes equivalents in a side-by-side reference.
Who is this lab for?
This lab is designed for:
- Engineers who have used Docker (pulled and run a few images, understand
-panddocker ps) and are starting their Kubernetes journey. - CKAD and AZ-104 candidates with a Docker background who need a concrete mental bridge before absorbing Deployments, Services, and ConfigMaps.
- Anyone who has watched a
kubectltutorial and wished someone would just show the same container running both ways on the same machine.
Verified against your live environment
An automated validation engine inspects your actual resources and configurations as you work. Completion means the task was performed, not multiple choice, real-world proficiency.
More labs like this
Your First Docker Containers - Pull, Run, and Manage
Pull images from Docker Hub, run named containers with published ports, exec into them, view logs, then stop and remove them cleanly.
Deploy Multi-Container Apps with Docker Compose
Author a compose.yaml that runs nginx, a Python API, and Postgres as a single declarative multi-service stack.
Speed Up Docker Builds with Layer Caching and dockerignore
Refactor a slow Dockerfile to leverage layer caching, add a .dockerignore to shrink the build context, and inspect the resulting image with docker history and docker diff.
Environment
Every lab includes
- Real environment, pre-credentialed
- Automated checks on every step
- Isolated sandbox, auto cleanup
- AI-recommended next steps
Lab curriculum
- 01
Getting Started with Kubernetes IDE
1 automated check
- 02
Run nginx alpine with Docker on the Host
1 automated check
- 03
Run the Same Container as a Pod with kubectl run
1 automated check
- 04
Reveal the Implicit Pod Manifest with dry-run
1 automated check
- 05
Fill In the Docker to Kubernetes Verb Map
1 automated check
Skills validated
Not the lab you were looking for?
Browse 200+ hands-on labs across AWS, Azure, Kubernetes, Docker, and cloud security.