Docker

Untitled section

Untitled content 1

Managing Dev Environment

Using Docker

Untitled content 2

Agenda

  • About Docker
  • VM vs Container
  • Images
  • Containers
  • Dockerfile
  • Basic Commands
  • Set Up Dev Environment

Untitled content 3

Docker

Build, Ship and Run Any App, Anywhere

  • Open

Docker containers are based on open standards allowing containers to run on all major Linux distributions and Microsoft operating systems with support for every infrastructure.

  • Lightweight

Containers running on a single machine all share the same operating system kernel so they start instantly and make more efficient use of RAM. Images are constructed from layered filesystems so they can share common files, making disk usage and image downloads much more efficient.

  • Secure

Containers isolate applications from each other and the underlying infrastructure while providing an added layer of protection for the application.

Untitled content 4

VM vs Docker

  • Virtual Machines
    • Each virtual machine includes the application, the necessary binaries and libraries and an entire guest operating system - all of which may be tens of GBs in size.

  • Containers
    • Containers include the application and all of its dependencies, but share the kernel with other containers. They run as an isolated process in userspace on the host operating system. They’re also not tied to any specific infrastructure – Docker containers run on any computer, on any infrastructure and in any cloud.

Untitled content 5

Images

  • Read-only Layer is called an image.
  • An image never changes.

Untitled content 6

Containers

  • That read-write layer, plus the information about its Parent Image.
  • Some additional information like its unique id.
  • Networking configuration and Resource limits.

Untitled content 7

Dockerfile

  • Docker can build images automatically by reading the instructions from a Dockerfile.
  • A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.
  • Using docker build users can create an automated build that executes several command-line instructions in succession.

Untitled content 8

Basic Commands

  • pull
  • run
  • commit
  • ps
  • save
  • load
  • rm
  • rmi

Untitled content 9

Requirements and Installation

64 Bit OS

Refer: Instructions in Doker Website

Untitled content 10

Set Up Dev Environment

  1. Pull Base Image(Ubuntu, Centos, Debian)
  2. Install (Nginx, PHP 7-FPM, Mysql)
  3. Commit Image
  4. Display phpinfo();