Skip to the content.

Intro to Docker

-

Overview

-

What is Docker?

-

What is Docker?

“Docker is a full development platform for creating containerized apps”.

-

Getting Started

-

Download Docker Desktop

  1. Go to dockerHub (https://hub.docker.com/).
  2. Create an account (https://hub.docker.com/signup).
  3. Login with newly created account.
  4. Download docker desktop (https://download.docker.com/mac/stable/Docker.dmg).

-

Install Docker Desktop

  1. Double click on the dmg file downloaded in previous step.
  2. Follow the instructions on the wizard to install application.

-

Validate Docker Desktop Installation

  1. Launch Docker Desktop
  2. Login to Docker Desktop
  3. Open Terminal
  4. Type docker version. You should see information related to the docker installation.
  5. Type docker run hello-world. This will download and execute a docker image, thus validating you are able to access docker hub and download images from the the hub.

-

#Doing stuff with Docker

-

Unit: 1 Containers

###Configuration

-

In Terminal, type : docker version

zcw$ docker version 
Client:
    Version: 17.09.0-ce 
    API version: 1.32
    Go version: go1.8.3 
    Git commit: afdb6d4
    Built: Tue Sep 26 22:40:09 2017 
    OS/Arch: darwin/amd64


Server:
    Version: 17.09.0-ce
    API version: 1.32 (minimum version 1.12) 
    Go version: go1.8.3
    Git commit: afdb6d4
    Built: Tue Sep 26 22:45:38 2017

-

In Terminal, type : docker info

zcw$ docker info
Containers: 9 
    Running: 0
    Paused: 0 
    Stopped: 9 
    Images: 21
Server Version: 17.09.0-ce 
Storage Driver: overlay2
    Backing Filesystem: extfs
    Supports d_type: true 
Logging Driver: json-file 
Cgroup Driver: cgroupfs
Plugins:
    Volume: local
    Network: bridge host ipvlan macvlan null overlay

-

In Terminal, type : docker

zcw$ docker
Management Commands: 
   checkpoint Manage checkpoints
   config Manage Docker configs
   container Manage containers
   image Manage images
   network Manage networks
   node Manage Swarm nodes
   plugin Manage plugins
   secret Manage Docker secrets
   service Manage services
   stack Manage Docker stacks
   ...    

 

-

In Terminal, type : docker (continued)

zcw$ docker
Commands: 
   attach   Attach local standard input, output, and error streams to a running container
   build    Build an image from a Dockerfile
   commit   Create a new image from a container's changes
   cp       Copy files/folders between a container and the local filesystem
   create   Create a new container
   deploy   Deploy a new stack or update an existing stack
   diff     Inspect changes to files or directories on a container's filesystem 
   events   Get real time events from the server
   exec     Run a command in a running container
   export 
   history  Export a container's filesystem as a tar archive Show the history of an image
   images List images
 
 
   

-

Docker command line structure

Previous versions of docker used :

syntax : docker <mgt-command> (options) 
example: docker run

Newer versions :

syntax : docker <mgt-command> <sub-command> (options) 
example : docker container run

-

What we covered