Ankit

Docker 101-Part#2

Docker 101-Part#2

Docker-101 Part-2 which would enable you to install and validate the Docker community edition on your machine and in next Part we would be covering the Docker CLI commands for you to begin using various Docker commands.

Prepare your Docker environment

In this tutorial, we would begin by installing Docker CE(Community Edition) on MAC OS.

To begin with installation, we would need CentOS 7 with centos-extras repo enabled. Following commands would install the Docker CE on your Linux machine.

Note: We would be installing the latest release of Docker CE. In-case you are looking to install specific release please refer here

#setup the repository
$ sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2
$ sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

#Installing the Docker CE    
$ sudo yum install docker-ce docker-ce-cli containerd.io

#Start Docker Daemon
$ sudo systemctl start docker

Validate your Docker Setup

Once the installation is done you can validate your Docker setup by following commands.

Verify that Docker CE is installed correctly by running the hello-world image.

$ sudo docker run hello-world
    Unable to find image 'hello-world:latest' locally
    latest: Pulling from library/hello-world
    ca4f61b1923c: Pull complete
    Digest: sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7
    Status: Downloaded newer image for hello-world:latest

    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    ...

Run docker --version and ensure that you have a supported version of Docker:

$ docker --version

  Docker version 17.12.0-ce, build c97c6d6

Note: Docker Build number may be different based on the latest available build of Docker CE.

Run docker info to view even more details about your docker installation:

$ docker info

  Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
  Images: 0
  Server Version: 17.12.0-ce
  Storage Driver: overlay2
  ...

This concludes our this week’s series of Docker-101 Part-2, after which you should now have a running docker environment available in your Laptop/PC/Server/Virtual Machine.

Please share your views on the article and inputs to make it better for the next set of DIY articles we are bringing on Docker Containers.

comments powered by Disqus