{"id":24272477,"url":"https://github.com/awpala/docker-primer","last_synced_at":"2026-04-20T14:33:49.186Z","repository":{"id":271056297,"uuid":"912276037","full_name":"awpala/docker-primer","owner":"awpala","description":"A brief primer on Docker","archived":false,"fork":false,"pushed_at":"2025-01-05T05:43:42.000Z","size":337,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T06:33:49.435Z","etag":null,"topics":["docker","docker-compose","primer","primers"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awpala.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-05T05:14:58.000Z","updated_at":"2025-01-05T05:44:55.000Z","dependencies_parsed_at":"2025-01-05T06:26:28.526Z","dependency_job_id":"7f97c2a5-7806-47c6-9391-14253aa7de6d","html_url":"https://github.com/awpala/docker-primer","commit_stats":null,"previous_names":["awpala/docker-primer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/awpala/docker-primer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awpala%2Fdocker-primer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awpala%2Fdocker-primer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awpala%2Fdocker-primer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awpala%2Fdocker-primer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awpala","download_url":"https://codeload.github.com/awpala/docker-primer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awpala%2Fdocker-primer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32050935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","primer","primers"],"created_at":"2025-01-15T18:26:38.643Z","updated_at":"2026-04-20T14:33:49.154Z","avatar_url":"https://github.com/awpala.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Primer\n\n## Introduction\n\nThis brief primer discusses Docker at a conceptual level.\n\n\u003e [!IMPORTANT]\n\u003e ***High-level idea/summary***: Docker containerizes applications, thereby addressing the \"but it works on my machine\" problem.\n\n***Document Outline***:\n\n```\nBackground\n  VMs vs. Containers\n  Docker Primitives\nMore Advanced Docker Setups\n```\n\n## Background\n\n### VMs vs. Containers\n\nThe general purpose of Docker is to ***containerize*** an application, in order to create a ***standardized*** environment that is ***portable*** on a machine-to-machine basis. This in turn addresses a longstanding ***issue*** in the  field of software development:\n\n\u003e \"But it works on ***my*** machine, though!\" (i.e., but not necessarily others' machines)\n\nThe implications of this should be self-evident for a large organization, 100+ students course section, etc., particularly insofar as standardization, troubleshooting, etc. are concerned.\n\nThis is analogous to what a Virtual Machine (VM) has already accomplished previously, but the approach is fundamentally distinct, as the following [depiction](https://dazzyddos.github.io/posts/Docker-Build-Stage-Security-Best-Practices/) shows/contrasts:\n\n\u003ccenter\u003e\n\u003cimg src=\"./assets/001-vm-vs-container.jpg\" width=\"550\"\u003e\n\u003c/center\u003e\n\nWith a VM, the entire toolchain (***including*** the [guest] operating system) is provided as part of the standardized environment. Conversely, Docker uses **containers**, which are specified/configured on a per-application basis for the equivalent purpose, running on the corresponding **container engine** (which manages the sharing of resources, isolation between containers and from host, etc., serving an analogous role to the VM's ***hypervisor***).\n\n\u003e [!WARNING]\n\u003e It's ***not*** necessarily accurate to say that there is a relative efficiency/inefficiency between a VM vs. a Docker container per se. While in general Docker containers are intended to be relatively lightweight by design, nevertheless a VM can be packaged efficiently, a Docker container can be specified and/or implemented inefficiently, etc.\n\u003e\n\u003e In either case, both VMs and containers will generally add net overhead relative to running \"on bare metal\" (i.e., directly on the hardware, without a virtualization layer in between), with the optimization goal being to minimize this overhead accordingly.\n\n### Docker Primitives\n\nWith respect to Docker itself, there are a few core **primitives** involved, summarized as follows (among others):\n\n| Primitive | Description | Docs Reference |\n|:-|:-|:-|\n| Engine | The virtualization layer, which manages the Docker resources. This is installed automatically on the host system via [Docker Desktop](https://docs.docker.com/desktop/), which in turn provides a GUI to manage and interact with the various Docker components. | [Docker Engine](https://docs.docker.com/engine/) |\n| Image | A schematic/blueprint for creating containers. | [Dockerfile reference](https://docs.docker.com/reference/dockerfile/) |\n| Registry | A cloud-based repository for hosting and distributing Docker images. [Docker Hub](https://hub.docker.com/) is the canonical Docker registry, but it is also possible to self-host registries, and this is also a commonly provided service on major cloud platforms (e.g., AWS, Azure, GCP, etc.). | [Docker Hub overview](https://docs.docker.com/docker-hub/) |\n| Container | An ephemeral environment for running an application. The environment is specified by the corresponding Docker image, and has a consistent starting state based on this specification, immediately upon the container's creation. A container generally runs as an isolated process (both with respect to the host system and other containers), with correspondingly specified interaction/functionality being \"opted into\" (i.e., but otherwise \"opted out of\"/\"maximally isolated\" by default). | [Docker Containers](https://docs.docker.com/engine/containers/run/) |\n| Volume | Volumes (and related bind mounts) provide persistent, shared storage both across containers as well as independently of the lifetime/uptime of any given container(s). | [Storage](https://docs.docker.com/engine/storage/) |\n\n\u003e [!NOTE]\n\u003e See [here](https://docs.docker.com/get-started/docker-overview/#docker-architecture) for further discussion of these topics. More generally, the [Docker documentation](https://docs.docker.com/) is very comprehensive and well written.\n\n\u003e [!NOTE]\n\u003e Regardless of the host system (i.e., macOS, Windows, or Linux), the Docker Engine itself is ***Linux-based***.\n\u003e\n\u003e In the case of a ***Windows*** host, the corresponding Linux-based virtualization is provided by [WSL](https://aka.ms/wsl) (Windows Subsystem for Linux). Prior to introduction of WSL, Docker on Windows was virtualized using Hyper-V (which is still [supported](https://docs.docker.com/desktop/install/windows-install/), but WSL is generally recommended).\n\nDiagrammatically, the relationship between these primitives is as follows:\n\n\u003ccenter\u003e\n\u003cimg src=\"./assets/002-docker-primitives.png\" width=\"550\"\u003e\n\u003c/center\u003e\n\nAs depicted here:\n  * The ***Docker Container*** is a running process, which is isolated from the ***Host System*** and is specified from its originating ***Docker Image***. \n  * Furthermore, the Docker Image itself need not be present locally, but rather can also be hosted in a cloud-based ***registry*** (e.g., ***Docker Hub***) for subsequent retrieval/usage.\n  * Additionally, the container can be specified/configured in such a manner by which \"***remote***\" ***interaction*** from the host is readily available/possible (i.e., via VS Code or equivalent), including common/mutual sharing of files via mounted ***Docker Volumes***.\n\n## More Advanced Docker Setups\n\nBeyond this, more ***complex*** configurations are also possible, such as multi-container assemblies (which can be specified declaratively via [Docker Compose](https://docs.docker.com/compose/) files) interconnected via [networks](https://docs.docker.com/engine/network/) for DNS-like container-to-container communication (in addition to persisting storage and/or sharing data via volumes, etc.). This is particularly ubiquitous in modern microservices-based architectures, which can be readily provisioned and hosted on cloud-based infrastructure (many/most of which support Docker as a first-class service, along with related orchestration tools such as Kubernetes).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawpala%2Fdocker-primer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawpala%2Fdocker-primer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawpala%2Fdocker-primer/lists"}