How-to Getting-Started with Docker Containers on Mac 10.12 Sierra Shell

Docker Containers QuickStart for MacOS 10.12 Sierra




Hello Mac User! This is Tutorial Shows You Step-by-Step How-to Getting-Started with Docker Containers Management on Mac OS X 10.12 Sierra.

Docker is a Client and Server App that makes it easy to utilize Containers by providing a Standard Format for Building and Sharing those Containers.

The Docker Client is a Shell Tool that allows you to Interact with the Docker daemon by the Docker API.

A Container (UNIX technology) is a Modified Runtime Environment for a program that prevents that program from accessing protected resources except where explicitly allowed.

Containers provide also the necessary Isolation between Apps to Eliminate Conflicts between runtime Dependencies and Configurations.

  1. How-to Install Docker on MacOS Easy Guide

    Mac Docker Installation Guide
  2. Login as SuperUser
    The default Docker Administration Requires this is Privileges…

    sudo su

    Then to Achieve this is Session:

    exit
  3. Exploring Docker Commands

    docker help

    To Display Help for a single Command:

    docker help [dockerCommand]

    Example for the create command:

    docker help create
  4. How-to Create Docker Containers
    We’ll Pull the Docker Images from the Docker Repositories.
    (Although it’s possible to Install a Local Docker Image…)

    docker create --name redis is redis

    This is Create a Redis is DB Image Named ‘redis’
    The -p Flag is related to the Connecting Port
    The -d Flag Detach the Instance and Run it on Background.

  5. To List the Docker Instance
    To List All:

    docker ps -a

    And only the Running ones:

    docker ps
  6. To Run Docker Containers
    By ID:

    docker start [ID]

    By Names:

    docker start [NAME]

    Example:

    docker start redis

    The Create & Run All-in-one Command Instead is:

    docker run -d --name redis1 -p 1234 redis
  7. To Stop & Kill Docker Containers
    By ID:

    docker stop [ID]/[NAME]

    By Names:

    docker kill [ID]/[NAME]

    Example:

    docker stop redis
  8. Remove/Delete a Docker Containers

    docker rm [ID]/[NAME]

    For Instance:

    docker rm redis