Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

of

Start your adventure with docker Slide 1 Start your adventure with docker Slide 2 Start your adventure with docker Slide 3 Start your adventure with docker Slide 4 Start your adventure with docker Slide 5 Start your adventure with docker Slide 6 Start your adventure with docker Slide 7 Start your adventure with docker Slide 8 Start your adventure with docker Slide 9 Start your adventure with docker Slide 10 Start your adventure with docker Slide 11 Start your adventure with docker Slide 12 Start your adventure with docker Slide 13 Start your adventure with docker Slide 14 Start your adventure with docker Slide 15 Start your adventure with docker Slide 16 Start your adventure with docker Slide 17 Start your adventure with docker Slide 18 Start your adventure with docker Slide 19 Start your adventure with docker Slide 20 Start your adventure with docker Slide 21 Start your adventure with docker Slide 22 Start your adventure with docker Slide 23 Start your adventure with docker Slide 24 Start your adventure with docker Slide 25 Start your adventure with docker Slide 26 Start your adventure with docker Slide 27 Start your adventure with docker Slide 28 Start your adventure with docker Slide 29 Start your adventure with docker Slide 30 Start your adventure with docker Slide 31 Start your adventure with docker Slide 32 Start your adventure with docker Slide 33 Start your adventure with docker Slide 34 Start your adventure with docker Slide 35 Start your adventure with docker Slide 36 Start your adventure with docker Slide 37 Start your adventure with docker Slide 38 Start your adventure with docker Slide 39 Start your adventure with docker Slide 40 Start your adventure with docker Slide 41 Start your adventure with docker Slide 42 Start your adventure with docker Slide 43 Start your adventure with docker Slide 44 Start your adventure with docker Slide 45 Start your adventure with docker Slide 46
Upcoming SlideShare
What to Upload to SlideShare
Next
Download to read offline and view in fullscreen.

0 Likes

Share

Download to read offline

Start your adventure with docker

Download to read offline

This slide is just for beginner journey with docker who are eager to learn docker but don't know where to start or how it works. In here I am trying to explain every basic things of docker as simple as possible.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

Start your adventure with docker

  1. 1. Start your Adventure with Docker
  2. 2. WHY WE NEED DOCKER
  3. 3. WHY WE NEED DOCKER When comes to deploy app in server we have to install various resources or packages for the app configuration. On the other side you have another team build a app under node js, maybe you hire a freelancer who would make app by php but another version and so on …
  4. 4. If you install all of this requirement in a single server high chances for app crashes. But on the other hand, your developer might say it's all fault for the person who has responsible for deployment.
  5. 5. That’s where came
  6. 6. WHAT CAN IT DO
  7. 7. Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package. WHAT CAN IT DO
  8. 8. By doing so, thanks to the container, the developer can rest assured that the application will run on any other Linux machine regardless of any customized settings that machine might have that could differ from the machine used for writing and testing the code. Source: https://opensource.com/resources/what-docker WHAT CAN IT DO
  9. 9. It's like a virtual machine but really a virtual machine. Its virtualize the application using same kernel making isolated environment. How it can perform
  10. 10. OS KERNEL MACHINE 1 DOCKERIZE APP Container 1 Container 2 Container 3 Container 4
  11. 11. DROP THE INSTANCE WHEN YOU DON'T NEED IT
  12. 12. BUT I AM STILL CONFUSED WHY I NEED THIS Scenario 1 Maybe you have a which run php 5.5 and you have php 5.5 installed in your system. Suddenly your supervisor asks you to deploy a laravel 5.6 app which supports php 7.1 But you can’t update php version your existing might have stop working or your apache lib might stop working.
  13. 13. BUT I AM STILL CONFUSED WHY I NEED THIS Scenario 2 Maybe your application is not working with other application because both application share same network configuration, same port number etc
  14. 14. BUT I AM STILL CONFUSED WHY I NEED THIS Scenario 3 Maybe your DevOps team have little knowledge about code or the platform you used in your application.
  15. 15. BUT I AM STILL CONFUSED WHY I NEED THIS Scenario 4 Maybe DevOps team don't have that much time for deploying app from scratch.
  16. 16. BUT I AM STILL CONFUSED WHY I NEED THIS Above all of this problem scenario has one solution and that is docker.
  17. 17. OS KERNEL OS KERNEL MACHINE 1 MACHINE 2 MULTIPLE DOCKERIZE
  18. 18. Q1. So it's more like Virtual machine, right? If not what is the difference between docker and virtual machine. Ans. No, it's not like virtual machine. Discussion in next slide...
  19. 19. OS KERNEL MACHINE 1 VIRTUALIZE APP KERNEL KERNEL KERNEL OS OS OS OS
  20. 20. Size Startup Integration
  21. 21. Let’s begin
  22. 22. Basic Docker Command https://labs.play-with-docker.com/
  23. 23. > docker Basic If you run docker command. It will list all necessary command
  24. 24. > docker run <image_name> RUN To start image it start with docker run > docker run ubuntu Example
  25. 25. > docker run <image_name>:10 Version Also specify the version of the image > docker run node:10 Example
  26. 26. > docker run -it <image_name>:10 I/O You can use I/O by specify the -it > docker run -it ubuntu /bin/bash Example
  27. 27. > docker run -p 8080:8000 <image_name>:10 Port mapping You can use port mapping by specify port Local_port: Docker_port > docker run -it ubuntu /bin/bash Example
  28. 28. Volume mapping You can map volume to source code to container source code > docker run -p 3306:3306 mysql -v opt/dataDir:/var/lib/mysql
  29. 29. Volume mapping
  30. 30. > docker run -d -p 8080:8000 <image_name> Run app detach mode You will run application in background mode by using -d > docker run -d -p 8080:8080 web_app Example
  31. 31. > docker run <image_name> php artisan serve Run command inside image Run bash command after the image name > docker run web_app php artisan serve Example
  32. 32. > docker run -h Others option You can get others command by using --help after docker run > docker run -h Example
  33. 33. DOCKER FILE
  34. 34. What is docker file
  35. 35. It's like a instruction file for building image. Like if want to deploy an app, you have to run many bash command to install package and extensions.
  36. 36. It looks like this. Where all the instruction written. Also there have certain requirement for write this file. You can find this from HERE Dockerfile
  37. 37. DOCKER COMPOSE
  38. 38. Docker Compose By docker compose you can write multiple services. Also you can easily link one service to another service. Learn more about docker compose from here. Also if confused about Docker compose and Dockerfile Click here for more detailed information.
  39. 39. LETS DEPLOY A APP USING DOCKER
  40. 40. package.json Make a package.json file and add this code to there. { "name": "docker_web_app", "version": "1.0.0", "description": "Node.js on Docker", "author": "First Last", "main": "server.js", "scripts": { "start": "node server.js" }, "dependencies": { "express": "^4.16.1" } }
  41. 41. server.js Make a server.js file and add this code to there. 'use strict'; const express = require('express'); // Constants const PORT = 8080; const HOST = '0.0.0.0'; // App const app = express(); app.get('/', (req, res) => { res.send('Hello World'); }); app.listen(PORT, HOST); console.log(`Running http://${HOST}:${PORT}`);
  42. 42. Dockerfile Make a Dockerfile file and add this code to there. FROM node:10 # Create app directory WORKDIR /usr/src/app # Install app dependencies # A wildcard is used to ensure both package.json AND package-lock.json are copied # where available (npm@5+) COPY package*.json ./ RUN npm install # If you are building your code for production # RUN npm ci --only=production # Bundle app source COPY . . EXPOSE 8080 CMD [ "node", "server.js" ]
  43. 43. Build image Build image by running this command docker build -t node-web-app .
  44. 44. Build image Run app detach mode with map port 49160 docker run -p 49160:8080 -d node-web-app node server.js
  45. 45. More useful link ● https://kodekloud.com/ ● https://www.youtube.com/watch?v=wi-MGFhrad0&list=PLhW3qG5bs-L99pQsZ74f-LC- tOEsBp2rK ● https://medium.com/free-code-camp/a-beginner-friendly-introduction-to-containers-vms-and- docker-79a9e3e119b ● https://medium.com/@cramirez92/build-a-nodejs-cinema-microservice-and-deploying-it-with- docker-part-1-7e28e25bfa8b ● https://docs.docker.com/get-started/ ● https://www.youtube.com/watch?v=DgoKjlDteEA&list=PLea0WJq13cnDsF4MrbNaw3b4jI0GT9yKt
  46. 46. Thank You #stayhome #staysafe

This slide is just for beginner journey with docker who are eager to learn docker but don't know where to start or how it works. In here I am trying to explain every basic things of docker as simple as possible.

Views

Total views

1,843

On Slideshare

0

From embeds

0

Number of embeds

1,539

Actions

Downloads

8

Shares

0

Comments

0

Likes

0

×