Posts Tagged Under: docker

Install Docker for Mac using homebrew

Here’s the command I ran:

brew install bash-completion
brew cask install docker
brew install kubectl
brew cask install minikube

Then go to the gui launcher and start up docker, and follow the prompts.

Then open a terminal and you should fine the following cli tools installed.

$ docker version
Docker version 17.09.0-ce, build afdb6d4

$ docker-compose version
docker-compose version 1.16.1, build 6d1ac21

$ docker-machine --version
docker-machine version 0.12.2, build 9371605

$ kubectl version --client
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.2", GitCommit:"477efc3cbe6a7effca06bd1452fa356e2201e1ee", GitTreeState:"clean", BuildDate:"2017-04-19T20:33:11Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"darwin/amd64"}

Reference
https://docs.docker.com/docker-for-mac/install


Docker – An apache ‘hello world’ example

Here we’re going to build a simple docker container that is running apache web server and then access it from your laptop’s web browser.

We will be building our container using the official ubuntu docker image.

First off, pull down the ubuntu image, by running:

$ docker pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
ae79f2514705: Pull complete
5ad56d5fc149: Pull complete
170e558760e8: Pull complete
395460e233f5: Pull complete
6f01dc62e444: Pull complete
Digest: sha256:506e2d5852de1d7c90d538c5332bd3cc33b9cbd26f6ca653875899c505c82687
Status: Downloaded newer image for ubuntu:latest

Then confirm that you have this image now:

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED