Docker Fundamentals
Docker is a platform for building, shipping, and running applications in containers. It packages software with its dependencies into images, distributes them through registries, and executes them in isolated environments that behave consistently from a developer's laptop to production servers.
itVirtualization, containers, and orchestration | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Docker Fundamentals
Docker is a way to carry an application with the files and defaults it expects, then run that package as an isolated process. Before this arrangement, moving software often meant reconstructing an environment by hand and hoping the right library had not wandered off while nobody was looking. Docker makes the package explicit. The hope is still optional, but far less central.
The useful pair is image and container. An image is the read-only package: application files, runtime dependencies, and a default command. A container is one running instance with a writable layer and its own run-time settings. The image stays put while containers start, stop, and disappear. This is why a container is meant to be replaced instead of carefully nursed back to health like a houseplant with a pager.
The recipe is a Dockerfile, a text file that says how to build the image. Its instructions create layers, which Docker can reuse when their inputs did not change. Put stable dependency work before frequently changing application files when the build permits it. Otherwise each source edit sends the builder back to the beginning, where it will wait politely and consume your afternoon.
What changes between environments does not belong in that recipe. A container receives environment variables, arguments, mounts, network connections, published ports, and resource limits when it is created. That split is the whole trick: stable dependencies in the image; environment-specific state at run time. Credentials do not belong in image layers, even briefly. Images travel, and their history has a surprisingly good memory.
Data has the same inconvenient habit of outliving its container. A volume is Docker-managed persistent storage; use it when data must survive replacement. A bind mount connects a chosen host path to the container, which is useful for local source-code work but couples the result to that particular host. A writable container layer is for disposable state. If important data lives there, its disappearance is not a mystery. It is a scheduled feature.
Networking offers its own small trap. A process can listen inside its container without being reachable from outside the Docker host. Publishing a port creates the host-to-container forwarding rule; EXPOSE only records an intention. Keep published ports narrow, because the default host binding may reach farther than the laptop in front of you.
Read the Intro for the full architecture and the line between Docker and an orchestrator. Use the Cheatsheet when you need the object map, lifecycle, storage choices, and failure boundaries. The Practice Reference turns the sequence into commands, and the Exercise lets you build, run, inspect, replace, and remove one harmless local container. After that, Compose is the place to group several related services, networks, and volumes without pretending that one host became a fleet.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://docs.docker.com/get-started/docker-overview/
Supports
- Docker client and daemon architecture
- Docker objects including images, containers, networks, and volumes
- Images as read-only templates and containers as runnable image instances
- Registry pull and push workflow and Docker Hub as the default public registry
- Namespaces and control groups as container isolation and resource mechanisms
- https://docs.docker.com/get-started/
Supports
- Official foundational learning path for installing Docker and learning its concepts
- Docker concepts and workshop as next steps for new users
- https://docs.docker.com/get-started/docker-concepts/
Supports
- Guided foundation covering images, containers, registries, ports, storage, and sharing applications
- https://docs.docker.com/get-started/docker-concepts/the-basics/what-is-an-image/
Supports
- Images as standardized packages of files, binaries, libraries, and configuration
- Image immutability and layered composition
- Base images and image selection from a registry
- https://docs.docker.com/reference/dockerfile/
Supports
- Dockerfile purpose and supported instructions
- Roles of FROM, COPY, RUN, WORKDIR, ENV, USER, EXPOSE, ENTRYPOINT, and CMD
- EXPOSE as port metadata rather than automatic port publishing
- https://docs.docker.com/build/cache/
Supports
- Image instructions producing ordered layers
- Reuse of unchanged build results
- Rebuilding downstream layers after a layer changes
- https://docs.docker.com/build/cache/invalidation/
Supports
- Cache checks for Dockerfile instructions and copied files
- Cache invalidation after changed ADD and COPY inputs
- Ordering stable work before frequently changed work
- https://docs.docker.com/engine/storage/
Supports
- Writable container layer lifecycle
- Volume, bind mount, tmpfs, and named-pipe storage choices
- Bind mounts linking host paths and containers
- tmpfs data living in host memory without disk persistence
- https://docs.docker.com/engine/storage/volumes/
Supports
- Volumes as Docker-managed persistent data stores
- Volume lifecycle independent from a container
- Volume and bind-mount decision guidance
- Named volume persistence after container removal
- https://docs.docker.com/engine/network/
Supports
- Default outgoing container connectivity
- User-defined networks and container-name communication
- Network attachment and published-port behavior
- Built-in network drivers and network isolation choices
- https://docs.docker.com/get-started/docker-concepts/running-containers/publishing-ports/
Supports
- Host-to-container port forwarding syntax and behavior
- Published ports binding to all host interfaces by default
- EXPOSE not publishing a port by itself
- https://docs.docker.com/compose/
Supports
- Compose as a tool for defining and running multi-container applications
- Services, networks, and volumes in one YAML configuration
- Lifecycle commands for a Compose application
- https://docs.docker.com/compose/intro/compose-application-model/
Supports
- Compose file and CLI relationship
- Services as application components connected through networks
- Compose application resources and project grouping
- https://docs.docker.com/engine/security/
Supports
- Docker Engine security areas including namespaces, control groups, daemon exposure, capabilities, and kernel hardening
- Root privileges of the standard daemon unless rootless mode is selected
- Resource accounting and limiting through control groups
- https://docs.docker.com/engine/security/rootless/
Supports
- Rootless daemon and containers running without root privileges
- User-namespace implementation and privilege-reduction purpose
- Rootless mode prerequisites and operational considerations
- https://docs.docker.com/reference/cli/docker/image/build/
Supports
- Building a tagged image from a Dockerfile and build context
- Build-context selection and build arguments used in the practice reference and exercise
- https://docs.docker.com/reference/cli/docker/container/run/
Supports
- Named container creation and loopback-only port publishing
- Runtime configuration used in the practice reference and exercise
- https://docs.docker.com/reference/cli/docker/inspect/
Supports
- Formatted inspection of configured container state and port mappings
- https://docs.docker.com/reference/cli/docker/container/logs/
Supports
- Retrieving the logs captured for a container
- https://docs.docker.com/reference/cli/docker/container/rm/
Supports
- Removing a stopped named container
- https://docs.docker.com/reference/cli/docker/image/rm/
Supports
- Removing a local image tag after dependent containers are removed
- https://docs.docker.com/build/concepts/context/
Supports
- Build context as the files available to Dockerfile COPY and ADD instructions
- Using .dockerignore to exclude unwanted files from the build context
- https://docs.docker.com/build/building/secrets/
Supports
- Build arguments and environment variables persisting in images
- Secret and SSH mounts for transient build credentials
- https://docs.docker.com/engine/release-notes/prior-releases/
Supports
- Docker Engine 0.1.4 release in April 2013
- Docker Engine 1.0.0 production support release on June 9, 2014
- https://docs.docker.com/compose/intro/history/
Supports
- Compose v1 first release in 2014
- Compose v2 announcement in 2020 and its Go implementation
- https://www.docker.com/blog/docker-1-10/
Supports
- Docker 1.10 release on February 4, 2016
- Compose support for networks and volumes plus user namespaces and seccomp profiles
- https://www.docker.com/blog/docker-1-12-built-in-orchestration/
Supports
- Docker 1.12 release on June 20, 2016
- Swarm mode services and nodes in Docker Engine
- https://www.docker.com/blog/whats-new-in-docker-1-13/
Supports
- Docker 1.13 release on January 19, 2017
- Compose-file support in docker stack deploy
- https://docs.docker.com/engine/release-notes/18.06/
Supports
- Docker Engine 18.06 release on July 18, 2018
- Experimental BuildKit builder backend
- https://www.docker.com/blog/announcing-the-compose-specification/
Supports
- Open Compose Specification announcement on April 7, 2020
- Cross-platform definition of multi-container applications
- https://www.docker.com/blog/announcing-compose-v2-general-availability/
Supports
- Docker Compose v2 general availability on April 26, 2022
- Integration of Compose v2 into the Docker CLI
- https://www.docker.com/products/docker-desktop/
Supports
- Docker Desktop as a local package for Docker Engine, the CLI, Compose, and graphical workflows
- https://podman-desktop.io/docs/intro
Supports
- Podman Desktop as a graphical local environment for container engines and Kubernetes
- https://docs.rancherdesktop.io/
Supports
- Rancher Desktop as a local Kubernetes and container-management environment
- https://orbstack.dev/
Supports
- OrbStack as a local Docker-compatible container environment
- https://github.com/abiosoft/colima
Supports
- Colima as open-source container runtimes for macOS and Linux
