{"id":23043308,"url":"https://github.com/theodorosploumis/docker-presentation","last_synced_at":"2025-08-14T23:30:44.816Z","repository":{"id":151061407,"uuid":"55821635","full_name":"theodorosploumis/docker-presentation","owner":"theodorosploumis","description":"An introduction to Docker for developers.","archived":false,"fork":false,"pushed_at":"2024-08-18T21:14:18.000Z","size":2624,"stargazers_count":28,"open_issues_count":0,"forks_count":27,"subscribers_count":1,"default_branch":"gh-pages","last_synced_at":"2025-04-03T02:35:20.395Z","etag":null,"topics":["docker","introduction","meetup","presentations"],"latest_commit_sha":null,"homepage":"http://theodorosploumis.github.io/docker-presentation/","language":"JavaScript","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/theodorosploumis.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":"2016-04-09T02:19:29.000Z","updated_at":"2024-08-18T21:14:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5695cbe-47f1-4d9c-9036-5f0da5e492cd","html_url":"https://github.com/theodorosploumis/docker-presentation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theodorosploumis/docker-presentation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodorosploumis%2Fdocker-presentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodorosploumis%2Fdocker-presentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodorosploumis%2Fdocker-presentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodorosploumis%2Fdocker-presentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theodorosploumis","download_url":"https://codeload.github.com/theodorosploumis/docker-presentation/tar.gz/refs/heads/gh-pages","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodorosploumis%2Fdocker-presentation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270499866,"owners_count":24595146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","introduction","meetup","presentations"],"created_at":"2024-12-15T20:46:58.919Z","updated_at":"2025-08-14T23:30:44.339Z","avatar_url":"https://github.com/theodorosploumis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Docker logo](https://raw.githubusercontent.com/theodorosploumis/docker-presentation/gh-pages/img/docker_logo.png)\n\n## Docker for Developers - Introduction\n\n#### [Python Meetup Thessaloniki](http://www.meetup.com/PyThess/), 15 April 2016\n\n###### [TheodorosPloumis.com](http://www.theodorosploumis.com/en) / [@theoploumis](http://twitter.com/theoploumis)\n________________________\n\n###### Get them: [online presentation](http://theodorosploumis.github.io/docker-presentation/) / [source code](https://github.com/theodorosploumis/docker-presentation) / [docker image](https://hub.docker.com/r/tplcom/docker-presentation/)\n\n###### Under [Attribution 4.0 International](http://creativecommons.org/licenses/by/4.0/) license.\n\n---\n\n### Let me ask you\n\n- Who knows about [Docker](http://docker.com)?\n- Who uses Docker for development?\n- Who uses Docker in production?\n- Who tried but could not do it?\n\n---\n\n### What is Docker (v1.11)\n\n\u003e Docker is an open platform for developing, shipping, and running applications.\n\n\u003e Docker allows you to package an application with all of its dependencies into a standardized unit for software development.\n\n---\n\n### Docker vs VMs\n\n![Docker vs traditional Virtualization](https://image.slidesharecdn.com/why-docker-website-130719212914-phpapp01-131208123039-phpapp01/95/hypervisor-versus-linux-containers-with-docker-25-638.jpg)\n\n---\n\n### Docker History\n\n - Solomon Hykes ([@solomonstre](https://twitter.com/solomonstre))\n - dotCloud (now Docker Inc)\n - March 2013\n - Apache 2.0 license\n - 30k stars on Github\n - 260k public repositories on hub.docker.com\n - Docker Inc acquires everyone \u003csmall\u003e\u003csup\u003eTM\u003c/sup\u003e\u003c/small\u003e\n - Docker joins the \"[Open Container Initiative](https://www.opencontainers.org/)\", June 2015\n\n---\n\n### Docker Benefits\n\n - Fast (deployment, migration, restarts)\n - Secure\n - Lightweight (save disk \u0026 CPU)\n - Open Source\n - Portable software\n - Microservices and integrations (APIs)\n - Simplify DevOps\n - Version control capabilities\n\n---\n\n### Common Docker usages\n\n - Sandbox environment (develop, test, debug, educate)\n - Continuous Integration \u0026 Deployment\n - Scaling apps\n - Development collaboration\n - Infrastructure configuration\n - Local development\n - Multi-tier applications\n - PaaS, SaaS\n\n###### See the [survey results for 2016](https://www.docker.com/survey-2016)\n\n---\n\n### Technology behind Docker\n\n - Linux [x86-64](https://www.wikiwand.com/en/X86-64)\n - [Go](https://golang.org/) language\n - [Client - Server](https://www.wikiwand.com/en/Client%E2%80%93server_model) (deamon) architecture\n - Union file systems ([UnionFS](https://www.wikiwand.com/en/UnionFS): AUFS, btrfs, vfs etc)\n - [Namespaces](https://en.wikipedia.org/wiki/Cgroups#NAMESPACE-ISOLATION) (pid, net, ipc, mnt, uts)\n - Control Groups ([cgroups](https://www.wikiwand.com/en/Cgroups))\n - Container format ([libcontainer](https://github.com/opencontainers/runc/tree/master/libcontainer \"Libcontainer provides a native Go implementation for creating containers with namespaces, cgroups, capabilities, and filesystem access controls. It allows you to manage the lifecycle of the container performing additional operations after the container is created.\"))\n\n###### See more at [Understanding docker](https://docs.docker.com/engine/understanding-docker/)\n\n---\n\n### The Docker architecture\n\n![Docker architecture](img/docker_architecture.jpg)\n###### See more at [Understanding docker](https://docs.docker.com/engine/understanding-docker/)\n\n---\n\n### Docker components\n\n - (Docker) client\n - daemon\n - engine\n - machine\n - compose\n - swarm\n - registry\n\n---\n\n### Docker client\n\nIt is the primary user interface to Docker. It accepts commands from the user\nand communicates back and forth with a Docker daemon.\n\n---\n\n### Docker daemon\n\nIt runs on a host machine. The user does not directly interact with the daemon,\nbut instead through the Docker client with the RESTful api or sockets.\n\n---\n\n### Docker engine\n\nA Client with a Daemon as also as the docker-compose tool. Usually referred simply as \"docker\".\n\n---\n\n### Docker machine\n\n![Docker machine logo](https://raw.githubusercontent.com/theodorosploumis/docker-presentation/gh-pages/img/docker_machine.png)\n\nA tool which makes it really easy to create Docker hosts on your computer,\non cloud providers and inside your own data center.\nIt creates servers, installs Docker on them, then configures the Docker client to talk to them.\nRequired for Mac, Windows users.\n\n---\n\n### Docker compose\n\n![Docker compose logo](https://raw.githubusercontent.com/theodorosploumis/docker-presentation/gh-pages/img/docker_compose.png)\n\nA tool for defining and running complex applications with Docker\n(eg a multi-container application) with a single file.\n\n---\n\n### Docker swarm\n\n![Docker swarm logo](https://raw.githubusercontent.com/theodorosploumis/docker-presentation/gh-pages/img/docker_swarm.png)\n\nA native clustering tool for Docker. Swarm pools together several Docker\nhosts and exposes them as a single virtual Docker host. It scale up to multiple hosts.\n\n---\n\n### Docker distribution\n\n![Docker distribution logo](https://raw.githubusercontent.com/theodorosploumis/docker-presentation/gh-pages/img/docker_distribution.png)\n\nA (hosted) service containing repositories of images which responds to the Registry API.\n\n---\n\n### Steps of a Docker workflow\n\n```\ndocker run -i -t -d ubuntu:15.04 /bin/bash\n```\n\n - Pulls the ubuntu:15.04 [image](https://docs.docker.com/engine/userguide/containers/dockerimages/ \"A read-only layer that is the base of your container. It can have a parent image to abstract away the more basic filesystem snapshot.\") from the [registry](https://docs.docker.com/registry/ \"The central place where all publicly published images live. You can search it, upload your images there and when you pull a docker image, it comes the repository/hub.\")\n - Creates a new [container](https://docs.docker.com/engine/userguide/storagedriver/imagesandcontainers/ \"A runnable instance of the image, basically it is a process isolated by docker that runs on top of the filesystem that an image provides.\")\n - Allocates a filesystem and mounts a read-write [layer](https://docs.docker.com/engine/reference/glossary/#filesystem \"A set of read-only files to provision the system. Think of a layer as a read only snapshot of the filesystem.\")\n - Allocates a [network/bridge interface](https://www.wikiwand.com/en/Bridging%20(networking))\n - Sets up an [IP address](https://www.wikiwand.com/en/IP_address \"An Internet Protocol address (IP address) is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication.\")\n - Executes a process that you specify (``` /bin/bash ```)\n - Captures and provides application output\n\n---\n\n### The docker image\n\n![ubuntu:15.04 image](img/docker_image.jpg \"\nA read-only layer that is the base of your container. It can have a parent image to abstract away the more basic filesystem snapshot. Each Docker image references a list of read-only layers that represent filesystem differences. Layers are stacked on top of each other to form a base for a container root filesystem.\")\n\n---\n\n### The docker container\n\n![container using ubuntu:15.04 image](img/docker_container.jpg \"\nA runnable instance of the image, basically it is a process isolated by docker that runs on top of the filesystem that an image provides. For each containers there is a new, thin, writable layer - container layer - on top of the underlying stack (image).\")\n\n---\n\n### The Dockerfile\n\n\u003e A Dockerfile is a text document that contains all the commands a user could call on the command line to create an image.\n\n - [Dockerfile with inline comments](https://github.com/theodorosploumis/docker-presentation/blob/gh-pages/examples/dockerfile/Dockerfile) just for education\n - [Dockerfile reference](https://docs.docker.com/engine/reference/builder/) on docker docs\n - Official Dockerfiles ([rails](https://github.com/docker-library/rails/blob/master/Dockerfile), [nodejs](https://github.com/ReadyTalk/nodejs-docker/blob/master/base/Dockerfile), [django](https://github.com/docker-library/django/blob/master/3.4/Dockerfile), [Drupal](https://github.com/docker-library/drupal/blob/master/9.3/php8.0/apache-bullseye/Dockerfile))\n\n---\n\n### Common Docker Commands\n\n```\n// General info\nman docker // man docker-run\ndocker help // docker help run\ndocker info\ndocker version\ndocker network ls\n\n// Images\ndocker images // docker [IMAGE_NAME]\ndocker pull [IMAGE] // docker push [IMAGE]\n\n// Containers\ndocker run\ndocker ps // docker ps -a, docker ps -l\ndocker stop/start/restart [CONTAINER]\ndocker stats [CONTAINER]\ndocker top [CONTAINER]\ndocker port [CONTAINER]\ndocker inspect [CONTAINER]\ndocker inspect -f \"{{ .State.StartedAt }}\" [CONTAINER]\ndocker rm [CONTAINER]\n\n```\n\n---\n\n### Docker examples\n\n- SSH into a container\n- Build an image\n- Docker [Volume](https://docs.docker.com/engine/userguide/containers/dockervolumes/)\n- [Linked](https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/) containers\n- Using [docker-compose](https://docs.docker.com/compose/)\n- Scale containers with docker-compose\n- Share an image (share this presentation)\n- Package an app with its environment\n- Screen and sound within containers (x-forward)\n\n---\n\n### Example: SSH into a container\n\n```\ndocker pull ubuntu\ndocker run -it --name ubuntu_example ubuntu /bin/bash\n```\n\n---\n\n### Example: Build an Image\n\nLet's build a [jenkins image](https://github.com/komljen/dockerfile-examples/blob/master/jenkins/Dockerfile)\n\n```\ncd ~/Docker-presentation\ngit clone git@github.com:komljen/dockerfile-examples.git.git\ncd dockerfile-examples/jenkins\ndocker build -t jenkins-local .\n\n// Test it\ndocker run -d -p 8099:8080 --name jenkins_example jenkins-local\n// Open http://localhost:8099\n```\n\n---\n\n### Example: Docker volume\n\nLet's use [Apache server](https://bitbucket.org/EdBoraas/apache-docker/src/)\n\n```\ncd ~/Docker-presentation\nmkdir apache-example\ncd apache-example\n\ndocker pull eboraas/apache\ndocker run --name apache_volume_example \\\n           -p 8180:80 -p 443:443 \\\n           -v $(pwd):/var/www/ \\\n           -d eboraas/apache\n\n// Locally create an index.html file\nmkdir html\ncd html\necho \"It works using mount.\" \u003e\u003e index.html\n\n// Open http://localhost:8180 to view the html file\n```\n\n---\n\n### Example: Docker link containers\n\nLet's create a [Drupal app](https://hub.docker.com/_/drupal/) (apache, php, mysql, drupal)\n\n```\ncd ~/Docker-presentation\nmkdir drupal-link-example\ncd drupal-link-example\n\ndocker pull drupal:8.0.6-apache\ndocker pull mysql:5.5\n\n// Start a container for mysql\ndocker run --name mysql_example \\\n           -e MYSQL_ROOT_PASSWORD=root \\\n           -e MYSQL_DATABASE=drupal \\\n           -e MYSQL_USER=drupal \\\n           -e MYSQL_PASSWORD=drupal \\\n           -d mysql:5.5\n\n// Start a Drupal container and link it with mysql\n// Usage: --link [name or id]:alias\ndocker run -d --name drupal_example \\\n           -p 8280:80 \\\n           --link mysql_example:mysql \\\n           drupal:8.0.6-apache\n\n// Open http://localhost:8280 to continue with the installation\n// On the db host use: mysql\n\n// There is a proper linking\ndocker inspect -f \"{{ .HostConfig.Links }}\" drupal_example\n```\n\n---\n\n### Example: Using Docker Compose\n\nLet's create a Drupal app with [docker-compose.yml](https://github.com/theodorosploumis/docker-presentation/blob/gh-pages/examples/docker-compose/docker-compose.yml)\n\n```\ncd ~/Docker-presentation\ngit clone git@github.com:theodorosploumis/docker-presentation.git\ncd docker-presentation/examples/docker-compose\n\n// Run docker-compose using the docker-compose.yml\ncat docker-compose.yml\ndocker-compose up -d\n```\n\n---\n\n### Example: Share a public Image\n\n```\ncd ~/Docker-presentation\ngit clone git@github.com:theodorosploumis/docker-presentation.git\ncd docker-presentation\n\ndocker pull nimmis/alpine-apache\ndocker build -t tplcom/docker-presentation .\n\n// Test it\ndocker run -itd --name docker_presentation \\\n           -p 8480:80 \\\n           tplcom/docker-presentation\n\n// Open http://localhost:8480, you should see this presentation\n\n// Push it on the hub.docker.com\ndocker push tplcom/docker-presentation\n```\n\n---\n\n### Example: Export/Save/Load etc\n\n```\ndocker pull nimmis/alpine-apache\ndocker run -d --name apache_example \\\n           nimmis/alpine-apache\n\n// Create a file inside the container.\n// See https://github.com/nimmis/docker-alpine-apache for details.\ndocker exec -ti apache_example \\\n            /bin/sh -c 'mkdir /test \u0026\u0026 echo \"This is it.\" \u003e\u003e /test/test.txt'\n\n// Test it. You should see message: \"This is it.\"\ndocker exec apache_example cat /test/test.txt\n\n// Commit the change.\ndocker commit apache_export_example myapache:latest\n\n// Create a new container with the new image.\ndocker run -d --name myapache_example myapache\n\n// You should see the new folder/file inside the myapache_example container.\ndocker exec myapache_example cat /test/test.txt\n\n// Export the container as image\ncd ~/Docker-presentation\ndocker export myapache_example \u003e myapache_example.tar\n\n// Import a new image from the exported files\ncd ~/Docker-presentation\ndocker import myapache_example.tar myapache:new\n\n// Save a new image as tar\ndocker save -o ~/Docker-presentation/myapache_image.tar myapache:new\n\n// Load an image from tar file\ndocker load \u003c myapache_image.tar\n\n```\n\n---\n\n### Example: GUI with Docker\n\nSee examples at [hub.docker.com/u/jess](https://hub.docker.com/u/jess/)\n\n```\n// Before staring we should grant access to everyone on the X Server (locally)\n// Otherwise the containers below will never start and they will not be able to use x11\nxhost +\n\n// Libreoffice\ndocker run  -d \\\n            -v /etc/localtime:/etc/localtime:ro \\\n            -v /tmp/.X11-unix:/tmp/.X11-unix \\\n            -e DISPLAY=unix$DISPLAY \\\n            -e GDK_SCALE \\\n            -e GDK_DPI_SCALE \\\n            --name libreoffice \\\n            jess/libreoffice\n\n// SublimeText 3\ndocker run -it \\\n           -v $HOME/.config/sublime-text-3/:/root/.config/sublime-text-3 \\\n           -v /tmp/.X11-unix:/tmp/.X11-unix \\\n           -e DISPLAY=$DISPLAY \\\n           --name sublime_text \\\n           jess/sublime-text-3\n\n// Audacity (sound in docker container)\ndocker run  -d \\\n            -v /etc/localtime:/etc/localtime:ro \\\n            -v /tmp/.X11-unix:/tmp/.X11-unix \\\n            -e DISPLAY=unix$DISPLAY \\\n            -e QT_DEVICE_PIXEL_RATIO \\\n            --device /dev/snd \\\n            --group-add audio \\\n            --name audacity \\\n            jess/audacity\n\n// Disable access to x11\nxhost -\n\n```\n\n---\n\n### Docker tips\n\nThere are known best practices (see a list at [examples/tips](https://github.com/theodorosploumis/docker-presentation/tree/gh-pages/examples/tips))\n\n- Optimize containers (check [fromlatest.io](https://www.fromlatest.io/), [wagoodman/dive](https://github.com/wagoodman/dive), [slimtoolkit](https://github.com/slimtoolkit/slim), [docker-squash](https://github.com/goldmann/docker-squash))\n- Create your own tiny base\n- Containers are not Virtual Machines\n- Full stack Images VS 1 process per Container\n- Create your private registry\n- Create shortcut commands\n- Use docker-compose.yml templates\n- Be aware of the hub.docker.com docker agent version\n\n---\n\n### The Docker war\n\n| Type | Software |\n|:----:|----------|\n| Clustering/orchestration | [Swarm](https://docs.docker.com/swarm/), [Kubernetes](http://kubernetes.io/), [Marathon](https://mesosphere.github.io/marathon/), [MaestroNG](https://github.com/signalfx/maestro-ng), [shipyard](http://shipyard-project.com/) |\n| Docker registries | [Portus](http://port.us.org/), [Docker Distribution](https://github.com/docker/distribution), [hub.docker.com](http://hub.docker.com), [quay.io](https://quay.io), [Google container registry](https://cloud.google.com/tools/container-registry/), [Artifactory](https://www.jfrog.com/artifactory/), [projectatomic.io](http://www.projectatomic.io/) |\n| PaaS with Docker | [Rancher](http://rancher.com/), [Tsuru](https://tsuru.io/), [dokku](https://github.com/dokku/dokku), [flynn](https://flynn.io/), [DEIS](http://deis.io/) |\n\n---\n\n### Docker Alternatives\n\n- [Rocket, rkt](https://github.com/coreos/rkt)\n- [Linux Containers, LXC](https://linuxcontainers.org/)\n- [Linux container hypervisor, LXD](http://www.ubuntu.com/cloud/lxd)\n- [BSD Jails](https://www.freebsd.org/doc/handbook/jails.html)\n- [Solaris Zones](http://oracle.com/solaris)\n- [drawbridge](http://research.microsoft.com/en-us/projects/drawbridge/)\n\n---\n\n### Instead of Resources\n\n - [Awesome Docker](https://github.com/veggiemonk/awesome-docker) (list of Docker resources \u0026 projects)\n - [Docker cheat sheet](https://github.com/wsargent/docker-cheat-sheet)\n - [Docker in Practice](https://www.manning.com/books/docker-in-practice), [The Docker Book](http://www.dockerbook.com/) (books)\n - [Docker aliases/shortcuts](https://github.com/theodorosploumis/docker-presentation/tree/gh-pages/examples/shortcuts/docker-aliases.sh)\n - Docker [case studies](https://www.docker.com/customers)\n\n---\n\n### Questions?\n\n![Pythons over Docker!](https://raw.githubusercontent.com/theodorosploumis/docker-presentation/gh-pages/img/docker_logo.png)\n\n[Review this presentation](https://goo.gl/lkau9t)\n\n\u003e Next: Docker in production, Scaling, Private registries, PaaS.\n\n###### In this presentation I have used [oh my zsh](http://ohmyz.sh/), [docker 1.11.1](https://github.com/docker/docker/releases/tag/v1.11.1), [wharfee](https://github.com/j-bennet/wharfee) and [dry](https://github.com/moncho/dry).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheodorosploumis%2Fdocker-presentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheodorosploumis%2Fdocker-presentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheodorosploumis%2Fdocker-presentation/lists"}