Docker Containers QuickStart for MacOS 10.12 Sierra
Hello Mac User! This 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 Linux 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.
Linux Containers provide also the necessary Isolation between Apps to Eliminate Conflicts between runtime Dependencies and Configurations.
How-to Install Docker on MacOS Easy GuideMac Docker Installation Guide
Login as SuperUser
The default Docker Administration Requires this Privileges…1sudo su
Then to Achieve this Session:1exit
Exploring Docker Commands1docker help
To Display Help for a single Command:1docker help [dockerCommand]
Example for the create command:1docker help create
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…)1docker create --name redis redis
This Create a Redis DB Image Named ‘redis’
The -p Flag is related to the Connecting Port
The -d Flag Detach the Instance and Run it on Background.
To List the Docker Instance
To List All:1docker ps -a
And only the Running ones:1docker ps
To Run Docker Containers
By ID:1docker start [ID]
By Names:1docker start [NAME]
Example:1docker start redis
The Create & Run All-in-one Command Instead is:1docker run -d --name redis1 -p 1234 redis
To Stop & Kill Docker Containers
By ID:1docker stop [ID]/[NAME]
By Names:1docker kill [ID]/[NAME]
Example:1docker stop redis
Remove/Delete a Docker Containers1docker rm [ID]/[NAME]
1docker rm redis