├── .gitignore ├── 01-Docker-Introduction └── README.md ├── 02-Docker-Installation └── README.md ├── 03-Pull-from-DockerHub-and-Run-Docker-Images └── README.md ├── 04-Build-new-Docker-Image-and-Run-and-Push-to-DockerHub ├── Nginx-DockerFiles │ ├── Dockerfile │ └── index.html └── README.md ├── 05-Essential-Docker-Commands └── README.md ├── README.md └── otherfiles └── presentation ├── Docker-Fundamentals-v1.pdf └── Docker-Fundamentals-v1.pptx /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | #Others 4 | /01-helloworld-rest-api/target/ 5 | 6 | # compiled output 7 | /dist 8 | /tmp 9 | /out-tsc 10 | 11 | # dependencies 12 | node_modules 13 | 14 | # IDEs and editors 15 | /.idea 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # IDE - VSCode 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | 30 | # misc 31 | /.sass-cache 32 | /connect.lock 33 | /coverage 34 | /libpeerconnection.log 35 | npm-debug.log 36 | yarn-error.log 37 | testem.log 38 | /typings 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | 44 | # Compiled class file 45 | *.class 46 | 47 | # Log file 48 | *.log 49 | 50 | # BlueJ files 51 | *.ctxt 52 | 53 | # Mobile Tools for Java (J2ME) 54 | .mtj.tmp/ 55 | 56 | # Package Files # 57 | *.jar 58 | *.war 59 | *.ear 60 | *.tar.gz 61 | *.rar 62 | *.cmd 63 | *.classpath 64 | *.settings 65 | *.project 66 | *.mvn 67 | mvnw 68 | target 69 | *.DS_Store 70 | 71 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 72 | hs_err_pid* 73 | -------------------------------------------------------------------------------- /01-Docker-Introduction/README.md: -------------------------------------------------------------------------------- 1 | # Docker Introduction 2 | 3 | ## Docker Introduction 4 | - What problems we have with Traditional Infra? 5 | - Why do we need to use Docker? 6 | - What are advantages of using Docker? 7 | - For introduction slides refer the [presentation slides](/otherfiles/presentation/Docker-Fundamentals-v1.pdf). 8 | 9 | 10 | # Docker Architecture 11 | 12 | ## Understand Docker Architecture & Docker Terminology 13 | - What is Docker Daemon? 14 | - What is Docker Client? 15 | - What are Docker Images? 16 | - What are Docker Containers? 17 | - What is Docker Registry or Docker Hub? 18 | - Refer the [presentation slides](/otherfiles/presentation/Docker-Fundamentals-v1.pdf). 19 | 20 | -------------------------------------------------------------------------------- /02-Docker-Installation/README.md: -------------------------------------------------------------------------------- 1 | # Docker Installation 2 | 3 | ## Docker Installations 4 | - https://docs.docker.com/install/ 5 | 6 | ## Docker Desktop on Windows 7 | - https://docs.docker.com/docker-for-windows/ 8 | 9 | ## Docker Desktop on MAC 10 | - https://docs.docker.com/docker-for-mac/ 11 | 12 | ### Troubleshooting Docker Desktop issues on MAC 13 | - Docker Desktop on mac has an issue with MAC **osxkeychain** 14 | - To fix it perform the below steps. 15 | - **Pre-requisite:** Refer below link for additional understanding 16 | - https://medium.com/@dakshika/error-creating-the-docker-image-on-macos-wso2-enterprise-integrator-tooling-dfb5b537b44e 17 | - **Step-1:** Docker Desktop changes 18 | - Open Docker Desktop --> Preferences 19 | - Uncheck the option named **Securely store Docker logins in macOS keychain** 20 | - **Step-2:** Go to **config.json** file in **.docker** folder 21 | - Sample Reference Location: 22 | - /Users//.docker/config.json 23 | - ~/.docker/config.json 24 | - Remove the line **“credSstore” : “osxkeychain”,** in config.json 25 | 26 | 27 | -------------------------------------------------------------------------------- /03-Pull-from-DockerHub-and-Run-Docker-Images/README.md: -------------------------------------------------------------------------------- 1 | # Flow-1: Pull Docker Image from Docker Hub and Run it 2 | 3 | ## Step-1: Verify Docker version and also login to Docker Hub 4 | ``` 5 | docker version 6 | docker login 7 | ``` 8 | 9 | ## Step-2: Pull Image from Docker Hub 10 | ``` 11 | docker pull stacksimplify/dockerintro-springboot-helloworld-rest-api:1.0.0-RELEASE 12 | ``` 13 | 14 | ## Step-3: Run the downloaded Docker Image & Access the Application 15 | - Copy the docker image name from Docker Hub 16 | ``` 17 | docker run --name app1 -p 80:8080 -d stacksimplify/dockerintro-springboot-helloworld-rest-api:1.0.0-RELEASE 18 | http://localhost/hello 19 | 20 | # For Mac with Apple Chips (use different application) 21 | Step-1: Install Docker with Apple Chips binary (https://docs.docker.com/desktop/mac/install/) on your mac machine 22 | 23 | Step-2: Run the simple Nginx Application container. 24 | docker run --name kube1 -p 80:80 --platform linux/amd64 -d stacksimplify/kubenginx:1.0.0 25 | http://localhost 26 | 27 | ## Sample Output 28 | kalyanreddy@Kalyans-Mac-mini-2 ~ % docker run --name kube1 -p 80:80 --platform linux/amd64 -d stacksimplify/kubenginx:1.0.0 29 | 370f238d97556813a4978572d24983d6aaf80d4300828a57f27cda3d3d8f0fec 30 | kalyanreddy@Kalyans-Mac-mini-2 ~ % curl http://localhost 31 | 32 | 33 | 34 |

Welcome to Stack Simplify

35 |

Kubernetes Fundamentals Demo

36 |

Application Version: V1

37 | 38 | % 39 | kalyanreddy@Kalyans-Mac-mini-2 ~ % 40 | 41 | ``` 42 | 43 | ## Step-4: List Running Containers 44 | ``` 45 | docker ps 46 | docker ps -a 47 | docker ps -a -q 48 | ``` 49 | 50 | ## Step-5: Connect to Container Terminal 51 | ``` 52 | docker exec -it /bin/sh 53 | ``` 54 | 55 | ## Step-6: Container Stop, Start 56 | ``` 57 | docker stop 58 | docker start 59 | ``` 60 | 61 | ## Step-7: Remove Container 62 | ``` 63 | docker stop 64 | docker rm 65 | ``` 66 | 67 | ## Step-8: Remove Image 68 | ``` 69 | docker images 70 | docker rmi 71 | ``` 72 | 73 | -------------------------------------------------------------------------------- /04-Build-new-Docker-Image-and-Run-and-Push-to-DockerHub/Nginx-DockerFiles/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | COPY index.html /usr/share/nginx/html -------------------------------------------------------------------------------- /04-Build-new-Docker-Image-and-Run-and-Push-to-DockerHub/Nginx-DockerFiles/index.html: -------------------------------------------------------------------------------- 1 | Welcome to Stack Simplify - NGINX-V1 - Custom Image 2 | -------------------------------------------------------------------------------- /04-Build-new-Docker-Image-and-Run-and-Push-to-DockerHub/README.md: -------------------------------------------------------------------------------- 1 | # Flow-2: Create a new Docker Image, Run as Container and Push to Docker Hub 2 | 3 | ## Pre-requisite Step 4 | - Create your Docker hub account. 5 | - https://hub.docker.com/ 6 | - **Important Note**: In the below listed commands wherever you see **stacksimplify** you can replace with your docker hub account id. 7 | 8 | 9 | ## Step-1: Run the base Nginx container 10 | - Access the URL http://localhost 11 | ``` 12 | docker run --name mynginxdefault -p 80:80 -d nginx 13 | docker ps 14 | docker stop mynginxdefault 15 | ``` 16 | 17 | ## Step-2: Create Dockerfile and copy our customized index.html 18 | - **Dockerfile** 19 | ``` 20 | FROM nginx 21 | COPY index.html /usr/share/nginx/html 22 | ``` 23 | 24 | ## Step-3: Build Docker Image & run it 25 | ``` 26 | docker build -t stacksimplify/mynginx_image1:v1 . 27 | docker run --name mynginx1 -p 80:80 -d stacksimplify/mynginx_image1:v1 28 | 29 | Replace your docker hub account Id 30 | docker build -t /mynginx_image1:v1 . 31 | docker run --name mynginx1 -p 80:80 -d /mynginx_image1:v1 32 | ``` 33 | 34 | ## Step-4: Tag & push the Docker image to docker hub 35 | ``` 36 | docker images 37 | docker tag stacksimplify/mynginx_image1:v1 stacksimplify/mynginx_image1:v1-release 38 | docker push stacksimplify/mynginx_image1:v1-release 39 | 40 | Replace your docker hub account Id 41 | docker tag /mynginx_image1:v1 /mynginx_image1:v1-release 42 | docker push /mynginx_image1:v1-release 43 | ``` 44 | ## Step-5: Verify the same on docker hub 45 | - Login to docker hub and verify the image we have pushed 46 | - Url: https://hub.docker.com/repositories -------------------------------------------------------------------------------- /05-Essential-Docker-Commands/README.md: -------------------------------------------------------------------------------- 1 | # Docker - Essential Commands 2 | - The below are the list of essential commands we are in need 3 | 4 | | Commands | Description | 5 | | ------------------------------- | --------------------------------------------- | 6 | | docker ps | List all running containers | 7 | | docker ps -a | List all containers stopped, running | 8 | | docker stop container-id | Stop the container which is running | 9 | | docker start container-id | Start the container which is stopped | 10 | | docker restart container-id | Restart the container which is running | 11 | | docker port container-id | List port mappings of a specific container | 12 | | docker rm container-id or name | Remove the stopped container | 13 | | docker rm -f container-id or name| Remove the running container forcefully | 14 | | docker pull image-info | Pull the image from docker hub repository | 15 | | docker pull stacksimplify/springboot-helloworld-rest-api:2.0.0-RELEASE | Pull the image from docker hub repository | 16 | | docker exec -it container-name /bin/sh | Connect to linux container and execute commands in container | 17 | | docker rmi image-id | Remove the docker image | 18 | | docker logout | Logout from docker hub | 19 | | docker login -u username -p password | Login to docker hub | 20 | | docker stats | Display a live stream of container(s) resource usage statistics | 21 | | docker top container-id or name | Display the running processes of a container | 22 | | docker version | Show the Docker version information | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker Fundamentals 2 | 3 | ## What is covered as part of Docker Fundamentals? 4 | 1. Docker Introduction 5 | 2. Docker Installation 6 | 3. Flow-1: Pull from Docker Hub and Run Docker Image locally. 7 | 4. Flow-2: Build new Docker Image and Run locally and Push to Docker Hub. 8 | 5. Essential Docker Commands 9 | 10 | ## Docker Images used 11 | | Application Name | Docker Image Name | 12 | | ------------------------------- | --------------------------------------------- | 13 | | Nginx | nginx | 14 | | Customized Nginx | stacksimplify/mynginx_image1 | 15 | | Simple SpringBoot HelloWorld | stacksimplify / dockerintro-springboot-helloworld-rest-api | 16 | -------------------------------------------------------------------------------- /otherfiles/presentation/Docker-Fundamentals-v1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/docker-fundamentals/c539fea7b5cecf61239d5934ac0ff4eb53b025bb/otherfiles/presentation/Docker-Fundamentals-v1.pdf -------------------------------------------------------------------------------- /otherfiles/presentation/Docker-Fundamentals-v1.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stacksimplify/docker-fundamentals/c539fea7b5cecf61239d5934ac0ff4eb53b025bb/otherfiles/presentation/Docker-Fundamentals-v1.pptx --------------------------------------------------------------------------------