{"id":15127599,"url":"https://github.com/omerbsezer/fast-docker","last_synced_at":"2025-05-15T12:03:09.224Z","repository":{"id":40895133,"uuid":"353393127","full_name":"omerbsezer/Fast-Docker","owner":"omerbsezer","description":"This repo covers containerization and Docker Environment: Docker File, Image, Container, Commands, Volumes, Networks, Swarm, Stack, Service, possible scenarios.","archived":false,"fork":false,"pushed_at":"2025-01-14T09:47:26.000Z","size":177,"stargazers_count":617,"open_issues_count":1,"forks_count":149,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-14T19:59:32.997Z","etag":null,"topics":["docker","docker-compose","docker-compose-template","docker-container","docker-image","docker-images","docker-network","docker-registry","docker-service","docker-stack","docker-swarm","docker-tutorial","docker-volumes","dockerfile","dockerhub","how-to","play-with-docker","swarm-mode","swarm-mode-cluster"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omerbsezer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-03-31T14:53:55.000Z","updated_at":"2025-04-13T04:15:55.000Z","dependencies_parsed_at":"2024-10-09T16:20:51.413Z","dependency_job_id":"e6a64f17-7a6f-40bd-b6f5-9bccb42ecd08","html_url":"https://github.com/omerbsezer/Fast-Docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omerbsezer%2FFast-Docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omerbsezer%2FFast-Docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omerbsezer%2FFast-Docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omerbsezer%2FFast-Docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omerbsezer","download_url":"https://codeload.github.com/omerbsezer/Fast-Docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337612,"owners_count":22054253,"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","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","docker-compose-template","docker-container","docker-image","docker-images","docker-network","docker-registry","docker-service","docker-stack","docker-swarm","docker-tutorial","docker-volumes","dockerfile","dockerhub","how-to","play-with-docker","swarm-mode","swarm-mode-cluster"],"created_at":"2024-09-26T02:04:59.510Z","updated_at":"2025-05-15T12:03:09.201Z","avatar_url":"https://github.com/omerbsezer.png","language":"Dockerfile","readme":"# Fast-Docker\nThis repo aims to cover Docker details (Dockerfile, Image, Container, Commands, Volumes, Docker-Compose, Networks, Swarm, Stack) quickly, and possible example usage scenarios (HowTo: LABs) in a nutshell. Possible usage scenarios are aimed to update over time.\n\n**Keywords:** Docker-Image, Dockerfile, Containerization, Docker-Compose, Docker-Volume, Docker-Network, Docker-Swarm, Service, Cheatsheet.\n\n# Quick Look (HowTo: LABs)\n- [LAB-01: Creating First Docker Image and Container using Docker File](https://github.com/omerbsezer/Fast-Docker/blob/main/LAB01-FirstImageFirstContainer.md)\n- [LAB-02: Binding Volume to the Different Containers](https://github.com/omerbsezer/Fast-Docker/blob/main/LAB02-DockerVolume.md)\n    - [LAB-02.1: Binding Mount to the Container](https://github.com/omerbsezer/Fast-Docker/blob/main/LAB02-DockerVolume.md#app_mount)\n- [LAB-03: Docker-Compose File - Creating 2 Different Containers:  WordPress Container depends on MySql Container](https://github.com/omerbsezer/Fast-Docker/blob/main/LAB03-DockerCompose.md)\n- [LAB-04: Creating Docker Swarm Cluster With 5 PCs using PlayWithDocker : 3 x WordPress Containers and 1 x MySql Container using Docker-Compose File](https://github.com/omerbsezer/Fast-Docker/blob/main/LAB04-DockerStackService.md)\n- [LAB-05: Running Docker Free Local Registry, Tagging Image, Pushing Image to the Local Registry, Pulling Image From Local Registry and Deleting Images from Local Registry](https://github.com/omerbsezer/Fast-Docker/blob/main/LAB05-DockerLocalRegistry.md)\n- [LAB-06: Transferring Content between Host PC and Docker Container](https://github.com/omerbsezer/Fast-Docker/blob/main/LAB06-DockerTransferringContent.md)\n- [LAB-07: Creating Docker Container using Dockerfile to Build C++ on Ubuntu18.04](https://github.com/omerbsezer/Fast-Docker/blob/main/LAB07-DockerfileForLinuxC++Build.md)\n- [LAB-08: Creating Docker Container using Dockerfile to Build C++ on Windows](https://github.com/omerbsezer/Fast-Docker/blob/main/LAB08-DockerfileForWindowsC++Build.md)\n- [LAB-09: Docker Configuration (Proxy, Registry)](https://github.com/omerbsezer/Fast-Docker/blob/main/LAB09-DockerConfiguration.md)\n- [Docker Commands Cheatsheet](https://github.com/omerbsezer/Fast-Docker/blob/main/DockerCommandCheatSheet.md)\n\n# Table of Contents\n- [Motivation](#motivation)\n    - [Needs](#needs)\n    - [Benefits](#benefits)\n    - [Problems Docker does not solve](#problems)\n- [What is Docker?](#whatisdocker)\n    - [Architecture](#architecture)\n    - [Installation](#installation)\n    - [Docker Engine (Deamon, REST API, CLI)](#engine)\n    - [Docker Registry and Docker Hub](#registry)\n    - [Docker Command Structure](#command)\n    - [Docker Container](#container)\n    - [Docker Volumes/Bind Mounts](#volume)\n    - [Docker Network](#network)\n    - [Docker Log](#log)\n    - [Docker Stats/Memory-CPU Limitations](#stats)\n    - [Docker Environment Variables](#variables)\n    - [Docker File](#file)\n    - [Docker Image](#image)\n    - [Docker Compose](#compose)\n    - [Docker Swarm](#swarm)\n    - [Docker Stack / Docker Service](#stack)\n- [Play With Docker](#playwithdocker)\n- [Docker Commands Cheatsheet](#cheatsheet)\n- [Other Useful Resources Related Docker ](#resource)\n- [References](#references)\n\n## Motivation \u003ca name=\"motivation\"\u003e\u003c/a\u003e\nWhy should we use Docker? \"Docker changed the way applications used to build and ship. It has completely revolutionized the containerization world.\" (Ref:ItNext)\n\n### Needs \u003ca name=\"needs\"\u003e\u003c/a\u003e\n- Installing all dependencies, setting up a new environment for SW (time-consuming every time to install environment for testing ) \n- We want to run our apps on different platforms (Ubuntu, Windows, Raspberry Pi).\n    - Question in our mind: What if, it does not run on a different OS?\n- CI/CD Integration Testing: We can handle unit testing, component testing with Jenkins. What if integration testing? \n    - Extending Chain: Jenkins- Docker Image - Docker Container - Automatic testing\n- Are our SW products portable to carry on different PC easily? (especially in the development \u0026 testing phase)\n- Developing, testing, maintenance of code as one Monolithic App could be problematic when the app needs more features/services. It is required to convert one big monolithic app into microservices. \n\n### Benefits \u003ca name=\"benefits\"\u003e\u003c/a\u003e\n\n- NOT needed to install dependencies/SWs again \u0026 again\n- Enables to run on different OS, different platforms\n- Enables a consistent environment\n- Enables more efficient use of system resources\n- Easy to use and maintain\n- Efficient use of the system resources\n- Isolate SW components\n- Enables faster software delivery cycles\n- Containers give us instant application portability.\n- Enables developers to easily pack, ship, and run any application as a lightweight, portable, self-sufficient container\n- Microservice Architecture (Monolithic Apps to MicroService Architecture, e.g. [Cloud Native App](https://docs.microsoft.com/en-us/dotnet/architecture/cloud-native/introduction))\n\n(Ref: Infoworld)\n\n### Problems Docker does not solve\u003ca name=\"problems\"\u003e\u003c/a\u003e\n- Docker does NOT fix your security issues\n- Docker does NOT turn applications magically into microservices\n- Docker isn’t a substitute for virtual machines\n\n(Ref: Infoworld)\n\n## What is Docker?  \u003ca name=\"whatisdocker\"\u003e\u003c/a\u003e\n- Docker is a tool that reduces the gap between the Development/Deployment phase of a software development cycle.\n- Docker is like a VM but it has more features than VMs (no kernel, only small app and file systems, portable)\n    - On Linux Kernel (2000s) two features are added (these features support Docker):\n        - Namespaces: Isolate process.\n        - Control Groups: Resource usage (CPU, Memory) isolation and limitation for each process. \n- Without Docker, each VM consumes 30% of resources (Memory, CPU)\n\n![image](https://user-images.githubusercontent.com/10358317/113183089-ef51fa00-9253-11eb-9ade-771905ce8ebd.png) (Ref: Docker.com)\n\n### Architecture  \u003ca name=\"architecture\"\u003e\u003c/a\u003e\n\n![image](https://user-images.githubusercontent.com/10358317/113183210-0db7f580-9254-11eb-9716-0de635f3cbdf.png) (Ref: docs.docker.com)\n\n\n### Installation  \u003ca name=\"installation\"\u003e\u003c/a\u003e\n\n- Linux: Docker Engine\n    - https://docs.docker.com/engine/install/ubuntu/\n- Windows: Docker Desktop for Windows \n    - WSL: Windows Subsystem for Linux, \n    - WSL2: virtualization through a highly optimized subset of Hyper-V to run the kernel and distributions, better than WLS.\n        - https://docs.docker.com/docker-for-windows/install/\n- Mac-OS: Docker Desktop for Mac\n    - https://docs.docker.com/docker-for-mac/install/\n\n### Docker Engine (Deamon, REST API, CLI)  \u003ca name=\"engine\"\u003e\u003c/a\u003e\n- There are mainly 3 components in the Docker Engine:\n    - Server is the docker daemon named docker daemon. Creates and manages docker images, containers, networks, etc.\n    - Rest API instructs docker daemon what to do.\n    - Command Line Interface (CLI) is the client used to enter docker commands.\n\n![image](https://user-images.githubusercontent.com/10358317/113183406-45bf3880-9254-11eb-8d13-e68c83f3d349.png) (Ref: Docker.com)\n\n### Docker Registry and Docker Hub  \u003ca name=\"registry\"\u003e\u003c/a\u003e\n\n- https://hub.docker.com/\n\n![image](https://user-images.githubusercontent.com/10358317/113183434-4eb00a00-9254-11eb-9275-9b1ccf705d5b.png) \n\n[App: Running Docker Free Local Registry, Tagging Container, Pushing to Local Registry, Pulling From Local Registry and Deleting Images from Local Registry](https://github.com/omerbsezer/Fast-Docker/blob/main/DockerLocalRegistry.md)\n\n### Docker Command Structure  \u003ca name=\"command\"\u003e\u003c/a\u003e\n\n- docker [ManagementCommand] [Command] \n\n```\ndocker container ls -a\ndocker image ls\ndocker volume ls\ndocker network ls\ndocker container rm -f [containerName or containerID]\n```\n\n![image](https://user-images.githubusercontent.com/10358317/113183615-81f29900-9254-11eb-8695-360680931866.png)\n\n![image](https://user-images.githubusercontent.com/10358317/113183721-9fbffe00-9254-11eb-9841-79bf037db34a.png)\n\n### Docker Container  \u003ca name=\"container\"\u003e\u003c/a\u003e\n\n![image](https://user-images.githubusercontent.com/10358317/113183556-730be680-9254-11eb-8bdd-84c5cf5b86c6.png) (Ref: docker-handbook-borosan)\n\n- When we create the container from the image, in every container, there is an application that is set to run by default app. \n    - When this app runs, the container runs.\n    - When this default app finishes/stops, the container stops. \n- There could be more than one app in docker image (such as: sh, ls, basic commands)\n- When the Docker container is started, it is allowed that a single application is configured to run automatically.\n\n```\ndocker container run --name mywebserver -d -p 80:80 -v test:/usr/share/nginx/html nginx\ndocker container ls -a\ndocker image pull alpine\ndocker image push alpine\ndocker image build -t hello . (run this command where “Dockerfile” is)\n(PS: image file name MUST be “Dockerfile”, no extension)\ndocker save -o hello.tar test/hello\ndocker load -i \u003cpath to docker image tar file\u003e\ndocker load -i .\\hello.tar\n```\n\nGoto: [App: Creating First Docker Image and Container using Docker File](https://github.com/omerbsezer/Fast-Docker/blob/main/FirstImageFirstContainer.md)\n\n#### Docker Container: Life Cycle\n\n![image](https://user-images.githubusercontent.com/10358317/113186436-f67b0700-9257-11eb-9b2e-41ccf056e88b.png) (Ref: life-cycle-medium)\n\n```\ne.g. [imageName]=alpine, busybox, nginx, ubuntu, etc.\ndocker image pull [imageName]\ndocker container run [imageName]\ndocker container start [containerId or containerName]\ndocker container stop [containerId or containerName]\ndocker container pause [containerId or containerName]\ndocker container unpause [containerId or containerName]\n```\n\n#### Docker Container: Union File System  \u003ca name=\"container-filesystem\"\u003e\u003c/a\u003e\n- Images are read only (R/O).\n- When containers are created, new read-write (R/W) thin layer is created.\n\n![image](https://user-images.githubusercontent.com/10358317/113183883-d8f86e00-9254-11eb-994b-30c17fe9429b.png) (Ref: docs.docker.com)\n\n### Docker Volumes: Why Volumes needed?\n- Containers do not save the changes/logs when erased if there is not any binding to volume/mount. \n- For persistence, volumes/mounts MUST be used. \n- e.g. Creating a log file in the container. When the container is deleted, the log file also deleted with the container. So volumes/binding mounts MUST be used to provide persistence!\n\n![image](https://user-images.githubusercontent.com/10358317/113184189-2d035280-9255-11eb-9409-578ad1f2bd4b.png) (Ref: udemy-course:adan-zye-docker)\n\n### Docker Volumes/Bind Mounts  \u003ca name=\"volume\"\u003e\u003c/a\u003e\n\n- Volumes and binding mounts must be used for saving logs, output files, and input files.\n- When volumes bind to the directory in the container, this directory and volume are synchronized.\n\n```\ndocker volume create [volumeName]\ndocker volume create test\ndocker container run --name [containerName] -v [volumeName]:[pathInContainer] [imageName]\ndocker container run --name c1 -v test:/app alpine\n```\nGoto: [App: Binding Volume to the Different Containers](https://github.com/omerbsezer/Fast-Docker/blob/main/DockerVolume.md)\n\n#### Bind Mount\n```\ndocker container run --name [containerName] -v [pathInHost]:[pathInContainer] [imageName]\ndocker container run --name c1 -v C:\\test:/app alpine\n```\n![image](https://user-images.githubusercontent.com/10358317/113184347-57eda680-9255-11eb-811c-9f55efd11deb.png) (Ref: Docker.com)\n\nGoto: [App: Binding Mount to Container](https://github.com/omerbsezer/Fast-Docker/blob/main/DockerVolume.md#app_mount)\nGoto: [App: Transferring Content between Host PC and Docker Container](https://github.com/omerbsezer/Fast-Docker/blob/main/DockerTransferringContent.md)\n\n### Docker Network \u003ca name=\"network\"\u003e\u003c/a\u003e\n- Docker containers work like VMs.\n- Every Docker container has network connections\n- Docker Network Drivers:\n    - None\n    - Bridge\n    - Host\n    - Macvlan\n    - Overlay\n    \n#### Docker Network: Bridge\n- Default Network Driver: Bridge (--net bridge)\n\n```\ndocker network create [networkName]\ndocker network create bridge1\ndocker container run --name [containerName] --net [networkName] [imageName] \ndocker container run --name c1 --net bridge1 alpine sh\ndocker network inspect bridge1\ndocker container run --name c2 --net bridge1 alpine sh\ndocker network connect bridge1 c2\ndocker network inspect bridge1\ndocker network disconnect bridge1 c2\n```\n\n- Creating a new network using customized network parameters:\n\n```\ndocker network create --driver=bridge --subnet=10.10.0.0/16 --ip-range=10.10.10.0/24 --gateway=10.10.10.10 newbridge\n```\n\n![image](https://user-images.githubusercontent.com/10358317/113184949-1b6e7a80-9256-11eb-9a0c-fe5c62404a06.png) (Ref: Docker.com)\n\n#### Docker Network: Host\n- Containers reach host network interfaces (--net host)\n\n```\ndocker container run --name [containerName] --net [networkName] [imageName] \ndocker container run --name c1 --net host alpine sh\n```\n\n![image](https://user-images.githubusercontent.com/10358317/113185061-43f67480-9256-11eb-9b94-83735ce980ce.png) (Ref: Docker.com)\n\n#### Docker Network: MacVlan\n- Each Container has its own MAC interface (--net macvlan)\n\n![image](https://user-images.githubusercontent.com/10358317/113185105-52dd2700-9256-11eb-84f2-ef1880eb4f4c.png) (Ref: Docker.com)\n\n#### Docker Network: Overlay \n- Containers that work on different PCs/hosts can work as the same network (--net overlay)\n\n![image](https://user-images.githubusercontent.com/10358317/113185192-6e483200-9256-11eb-8cb4-d8aa170d1a1e.png) (Ref: Docker.com)\n\n#### Port Mapping/Publish:\n- Mapping Host PC's port to container port:\n \n ```\n-p [hostPort]:[containerPort], --publish [hostPort]:[containerPort] e.g. -p 8080:80, -p 80:80\ndocker container run --name mywebserver -d -p 80:80 nginx\n```\n\n### Docker Log  \u003ca name=\"log\"\u003e\u003c/a\u003e\n\n- Docker Logs show /dev/stdout, /dev/stderror\n\n```\ndocker logs --details [containerName]\n```\n\n![image](https://user-images.githubusercontent.com/10358317/113289697-d8151a00-92f0-11eb-86e6-6280c4bf2e77.png)\n\n\n### Docker Stats/Memory-CPU Limitations  \u003ca name=\"stats\"\u003e\u003c/a\u003e\n\n![image](https://user-images.githubusercontent.com/10358317/113289735-e9f6bd00-92f0-11eb-940b-13113a5a5da2.png)\n\n![image](https://user-images.githubusercontent.com/10358317/113289755-efec9e00-92f0-11eb-9f49-333a4608c523.png)\n\n![image](https://user-images.githubusercontent.com/10358317/113289773-f5e27f00-92f0-11eb-8c4f-2db75f17baeb.png)\n\n\n### Docker Environment Variables  \u003ca name=\"variables\"\u003e\u003c/a\u003e\n\n![image](https://user-images.githubusercontent.com/10358317/113289974-40fc9200-92f1-11eb-9f12-1125ec32eabf.png)\n\n\n### Docker File  \u003ca name=\"file\"\u003e\u003c/a\u003e\n\n![image](https://user-images.githubusercontent.com/10358317/113185932-54f3b580-9257-11eb-9f50-0d18512a0c40.png)\n\nGoto: [App: Creating Docker Container using Dockerfile to Build C++ on Ubuntu18.04](https://github.com/omerbsezer/Fast-Docker/blob/main/DockerfileForLinuxC%2B%2BBuild.md)\n\nGoto: [App: Creating Docker Container using Dockerfile to Build C++ on Windows](https://github.com/omerbsezer/Fast-Docker/blob/main/DockerfileForWindowsC%2B%2BBuild.md)\n\n#### Sample Docker Files\n\n```\nFROM python:alpine3.7\nCOPY . /app\nWORKDIR /app\nRUN pip install -r requirements.txt\nEXPOSE 5000\nCMD python ./index.py\n```\n\n```\nFROM ubuntu:18.04\nRUN apt-get update -y\nRUN apt-get install default-jre -y\nWORKDIR /myapp\nCOPY /myapp .\nCMD [\"java\",\"hello\"]\n```\n\n- Multistage Docker File (Creating temporary container):\n    - In the example, JDK (Java Development Kit) based temporary image (~440MB) container is created for compilation.\n    - Compiled files are copied into JRE (Java Runtime Environment) based image (~145MB). Finally, we have only JRE based image.\n```\nCOPY --from=\u003cstage 1\u003e stage1/src stage2/destination\n```\n- In the example below, 'compiler' is 'stage1'.\n```\nFROM mcr.microsoft.com/java/jdk:8-zulu-alpine AS compiler\nCOPY /myapp /usr/src/myapp\nWORKDIR /usr/src/myapp\nRUN javac hello.java\n\nFROM mcr.microsoft.com/java/jre:8-zulu-alpine \nWORKDIR /myapp\nCOPY --from=compiler /usr/src/myapp .\nCMD [\"java\", \"hello\"]\n```\n\n### Docker Image  \u003ca name=\"image\"\u003e\u003c/a\u003e\n\n- Create Image using Dockerfile\n```\ndocker image build -t hello . (run this command where “Dockerfile” is)\n(PS: image file name MUST be “Dockerfile”, no extension)\ndocker image pull [imageName]\ndocker image push [imageName]\ndocker image tag [imageOldName] [imageNewName]\n(PS: If you want to push DockerHub, [imageNewName]=[username]/[imageName]:[version])\ndocker save -o hello.tar test/hello\ndocker load -i \u003cpath to docker image tar file\u003e\ndocker load -i .\\hello.tar\n```\n\n![image](https://user-images.githubusercontent.com/10358317/113186047-748ade00-9257-11eb-9c1c-1604d53523e8.png)\n\nGoto: [App: Creating First Docker Image and Container using Docker File](https://github.com/omerbsezer/Fast-Docker/blob/main/FirstImageFirstContainer.md)\n\n### Docker Compose  \u003ca name=\"compose\"\u003e\u003c/a\u003e\n- Define and run multi-container applications with Docker.\n- Easy to create Docker components using one file: Docker-Compose file\n- It is a YAML file that defines components: \n    - Services, \n    - Volumes, \n    - Networks, \n    - Secrets\n- Sample \"docker-compose.yml\" file: \n\n```\nversion: \"3.8\"\n\nservices:\n  mydatabase:\n    image: mysql:5.7\n    restart: always\n    volumes: \n      - mydata:/var/lib/mysql\n    environment: \n      MYSQL_ROOT_PASSWORD: somewordpress\n      MYSQL_DATABASE: wordpress\n      MYSQL_USER: wordpress\n      MYSQL_PASSWORD: wordpress\n    networks:\n      - mynet\n  mywordpress:\n    image: wordpress:latest\n    depends_on: \n      - mydatabase\n    restart: always\n    ports:\n      - \"80:80\"\n      - \"443:443\"\n    environment: \n      WORDPRESS_DB_HOST: mydatabase:3306\n      WORDPRESS_DB_USER: wordpress\n      WORDPRESS_DB_PASSWORD: wordpress\n      WORDPRESS_DB_NAME: wordpress\n    networks:\n      - mynet\nvolumes:\n  mydata: {}\nnetworks:\n  mynet:\n    driver: bridge\n```\n\n- After saving the file as \"docker-compose.yml\", run the following commands where the docker-compose file is, to create containers, volumes, networks:\n\n```\ndocker-compose up -d\ndocker-compose down\n```\nGoto: [App: Docker-Compose File - Creating 2 Different Containers:  WordPress Container depends on MySql Container](https://github.com/omerbsezer/Fast-Docker/blob/main/DockerCompose.md)\n\n### Docker Swarm  \u003ca name=\"swarm\"\u003e\u003c/a\u003e\n\nOne of the Container Orchestration tool: \n- Automating and scheduling the \n    - deployment, \n    - management, \n    - scaling, and\n    - networking of containers\n- Container Orchestration tools:\n    - Docker Swarm,\n    - Kubernetes,\n    - Mesos\n\n![image](https://user-images.githubusercontent.com/10358317/113186661-3b06a280-9258-11eb-9bb8-3ad38d3c55fb.png) (Ref: udemy-course:adan-zye-docker)\n\n### Docker Stack / Docker Service  \u003ca name=\"stack\"\u003e\u003c/a\u003e\n- With Docker Stack, multiple services can be created with one file.\n- It is like a Docker-Compose file but it has more features than a Docker-compose file: update_config, replicas.\n- But it is running on when Docker Swarm mode is activated.\n- Network must be 'overlay'.\n\n#### Creating, Listing, Inspecting\n```\ndocker service create --name testservice --replicas=5 -p 8080:80 nginx\ndocker service ps testservice (listing running containers on which nodes)\ndocker service inspect testservice\n```\n#### Scaling\n```\ndocker service scale testservice=10 (scaling up the containers to 10 replicas)\n```\n#### Updating\n```\ndocker service update --detach --update-delay 5s --update-parallelism 2 --image nginx:v2 testservice (previous state: testservice created, now updating)\ndocker service update --help (to see the parameters of update)\n```\n#### Rollbacking\n```\ndocker service rollback --detach testservice (rollbacking to previous state)\n```\n\n![image](https://user-images.githubusercontent.com/10358317/113303356-4a8df600-9301-11eb-9114-38872ca01f29.png)\n\nGoto: [App: Creating Docker Swarm Cluster With 5 PCs using PlayWithDocker : 3 x WordPress Containers and 1 x MySql Container using Docker-Compose File](https://github.com/omerbsezer/Fast-Docker/blob/main/DockerStackService.md)\n\n## Play With Docker  \u003ca name=\"playwithdocker\"\u003e\u003c/a\u003e\n\n- https://labs.play-with-docker.com/\n\n![image](https://user-images.githubusercontent.com/10358317/113187037-ae101900-9258-11eb-9789-781ca2f6a464.png)\n\n## Docker Commands Cheatsheet \u003ca name=\"cheatsheet\"\u003e\u003c/a\u003e\n\nGoto: [Docker Commands Cheatsheet](https://github.com/omerbsezer/Fast-Docker/blob/main/DockerCommandCheatSheet.md)\n\n## Other Useful Resources Related Docker  \u003ca name=\"resource\"\u003e\u003c/a\u003e\n- Original Docker Document: https://docs.docker.com/get-started/\n- Cheatsheet: https://github.com/wsargent/docker-cheat-sheet\n- Workshop: https://dockerlabs.collabnix.com/workshop/docker/\n- All-in-one Docker Image for Deep Learning: https://github.com/floydhub/dl-docker\n- Various Dockerfiles for Different Purposes: https://github.com/jessfraz/dockerfiles\n- Docker Tutorial for Beginners [FULL COURSE in 3 Hours]- Youtube: https://www.youtube.com/watch?v=3c-iBn73dDE\u0026t=6831s\n- Docker and Kubernetes Tutorial | Full Course [2021] - Youtube: https://www.youtube.com/watch?v=bhBSlnQcq2k\u0026t=3088s\n\n## References  \u003ca name=\"references\"\u003e\u003c/a\u003e\n- [Docker.com](https://www.docker.com/)\n- [docs.docker.com](https://docs.docker.com/get-started/overview/)\n- [docker-handbook-borosan](https://borosan.gitbook.io/docker-handbook/docker-images)\n- [life-cycle-medium](https://medium.com/future-vision/docker-lifecycle-tutorial-and-quickstart-guide-c5fd5b987e0d)\n- [Infoworld](https://www.infoworld.com/article/3310941/why-you-should-use-docker-and-containers.html)\n- [ItNext](https://itnext.io/getting-started-with-docker-facts-you-should-know-d000e5815598)\n- [udemy-course:adan-zye-docker](https://www.udemy.com/course/adan-zye-docker/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomerbsezer%2Ffast-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomerbsezer%2Ffast-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomerbsezer%2Ffast-docker/lists"}