DevOps Training
  • DevOps
  • What is DevOps
    • What DevOps Look like
    • Why DevOps Needed
    • DevOps Automation Tools
    • DevOps Principles
  • cloud computing
    • How DevOps links with Cloud Computing
    • What is cloud computing?
      • Platform as a service (PaaS)
      • Infrastructure as a service (IaaS)
      • Software as a service (SaaS)
      • Function as a Service
      • SaaS, PaaS, IaaS
  • Version Control
    • Git as Version Control
      • Setting up Remote Repo
      • Git Hooks
      • github vs gitlab vs bitbucket
      • Quick Recap Git
  • DevOps #01 Continuous Integration
    • Continuous Integration & Continuous Delivery
      • Understanding CI Tools
      • Prerequisite
      • Continuous Integration
      • CI Tools
      • Travis-CI
        • Travis CI with S3
        • Static Site Build S3
        • Beanstalk with AWS CLI
          • Elastic Beanstalk with Travis CI
        • Travis using Code Deploy EC2
          • Github and Code Deploy
          • Travis CI with Code Deploy
      • Gitlab-CI
        • CI Setup for application
        • Gitlab Runners on EC2
        • CI Integration with AWS
          • Deploying App using Gitlab CI
          • Gitlab CI with AWS S3
          • Gitlab CI with ECS
          • CI Integration with EC2
            • Update and Clean Gitlab.yml
        • Install Gitlab on EC2
      • CI/CD using Jenkins CI
        • Jenkins Build on EC2
        • Jenkins Build EC2 Ubuntu
        • Jenkins CI/CD
          • Create a Build Item
          • Create a Build Pipleine
            • Pipeline Using Docker
            • Pipeline Examples
          • Jenkins CI with S3
            • Jenkins CI - S3
          • Jenkins CI with EC2
    • Jenkins CI Cluster Mode
    • AWS Code Pipeline CI/CD
      • AWS CI/CD Tools
        • AWS Code Build
        • AWS Code Deploy to Beanstalk
        • AWS Code Deploy to EC2
        • AWS Pipeline - Example CI/CD
  • Docker
    • Docker
      • Docker for Developers
        • Install and setup
        • Docker Commands
        • Docker Images Container
        • Docker Architecture
    • Docker Demos
      • Node JS Container
    • Docker-compose
      • Using Docker Compose
      • Docker Compose Demo
  • AWS Quick Refresh
    • AWS Quick Recap - Videos
    • AWS Quick Recap
  • AWS Architecture - Lab
    • Application Deployment - 01
    • Application Deployment - 02
    • Application 3 tier Architecture
  • Basic Networking
    • Computer Networking for Beginners
      • Basic of Networking
      • Networking Protocols
      • OSI Model
      • Network address and Host address
      • Subnetting Type
    • Network Architecture
    • Networking Layers OSI Model
    • Internet protocol
      • CIDR and subnetting
        • Examples
      • AWS VPC Subnets
  • VPC and Networking
    • AWS VPC
    • VPC Demo
      • Bastion Host | Jump Server
  • AWS Components
    • AWS Components In Depth
      • AWS Storage
        • AWS EBS
        • AWS Cloudfront
        • AWS S3
      • AWS Compute
        • ECS
        • AWS VPC
          • VPC Components
        • AWS EC2
        • AWS ELB
          • Application Load balancer
            • Example
        • AWS EC2 Auto Scaling
          • Demo
        • AWS Route 53
        • AWS Lambda Serverless
          • AWS Lambda Serverless Computing
  • Assignments
    • Assignment 01-Node JS app on EC2
    • Assignment 02-Node JS with Mysql
    • Assignment-03
  • Microservices
    • Microservices Architecture
      • Docker and Docker-Compose
      • Docker-Compose Example 01
      • Docker-Compose Example 02
      • Hand-on | Building Microservices
    • Architecture Components
  • AWS ECS
    • AWS ECS
      • Introduction of ECS
Powered by GitBook
On this page
  • Setup
  • Understand what we are running!
  • Try out the following Docker commands

Was this helpful?

  1. Docker
  2. Docker
  3. Docker for Developers

Install and setup

PreviousDocker for DevelopersNextDocker Commands

Last updated 5 years ago

Was this helpful?

Welcome to Docker! This guide will take you through the various mini-tutorials to help you understand Docker.

Setup

The first step is to ensure that you install Docker on your machine. Since this tutorial was first written, Docker is now available for installation on a number of Linux distributions and also available for Windows and Mac operating systems.

Please visit and select the Docker CE for installation on your platform. For the rest of the series, I shall be using Docker for Mac.

Once you have the setup done, I suggest that you test out your installation via the command given below:

Let’s try the hello-world example image. Give the following command at the prompt:

$ docker run hello-world

This should download the very small hello-world image and print a “Hello from Docker“ message.

Understand what we are running!

A lot of stuff happened behind the scenes to get the Hello World running. While we may not go into the specifics of all that for now, these are roughly the steps:

  1. You used the docker client application via the docker command.

  2. You gave the command run hello-world to the docker client application.

  3. In other words, you told the docker client to create an instance of a Docker Image titled hello-world.

  4. Where is this Docker Image? On your local system ? Somewhere on the Internet ? What is going on ?

  5. Well, the default behaviour is a sensible one i.e. the docker client looked for an Image titled hello-world in your local repository i.e. on your local machine. It did not find it (obviously) — so it went to the Internet and hit a URL at Docker Registry ( a public repository of Docker Images hosted by the company behind Docker). It found it there (I cheated … since I knew the name “hello-world” is one of the existing images out there. But you get the point). Once found, it started to download the Image (all its layers) and once it was present locally, it launched an instance (Container) based on that image.

  6. The default command was then executed to print out some message on the console, which is what you saw.

Try out the following Docker commands

Since the image “hello-world” is now present locally, it should be available in our local repository.

Try out :

$ docker images

and verify that you see the image listed there.

Try launching another container based on the same image. Give the following command:

$ docker run hello-world

It should print out the same message that you saw earlier.

The command $ docker ps gives you a list of running containers. Try it out and see if you can find any running.

Try out:

$ docker ps --all 

and see if they are visible now.

Use ‘ — help’ option. For e.g. docker ps — help

Even if you do not understand everything at this point in time, that is fine. These commands were meant to get you to start thinking of the typical operations you will need to understand/execute while dealing with Images / Containers.

https://docs.docker.com/engine/installation/#supported-platforms