Sitemap
Aizhan Smith

Aizhan Smith

How to Docker?

3 min readOct 20, 2019
Press enter or click to view image in full size

I can bet that at least once in life you will encounter one of these boring situations:

  • You are developing on machine with no admin rights.
  • It took you five hours to install the latest version of you favorite DB but your boss tells you the app will have to run on a previous version.
  • It took you years to build a perfectly clean application… that only works on your machine.

So sometimes you can spend more time for setting up your environment than actually work on the task.

Docker was created to satisfy this need for unification and normalisation: it makes it possible to split an application into several microservices, light, adaptable, universal and scalable, and it also gives the system administrators a great flexibility to deploy and scale up the app.

So how to install Docker on MAC OS?

1 If you don`t have Homebrew or it works uncorrectly as it was on my machine, than just delete it:

$ cd ~
$ rm -rf .brew

2 install Homebrew

$ mkdir $HOME/.brew && curl -fsSL
https://github.com/Homebrew/brew/tarball/master | tar xz — strip 1 -C $HOME/.brew
mkdir -p /tmp/.$(whoami)-brew-locks
mkdir -p $HOME/.brew/var/homebrew
ln -s /tmp/.$(whoami)-brew-locks $HOME/.brew/var/homebrew/locks
export PATH=”$HOME/.brew/bin:$PATH”
brew update && brew upgrade```Afterwards make sure you add the following lines to your `.zshrc`.``mkdir -p /tmp/.$(whoami)-brew-locks
export PATH=”$HOME/.brew/bin:$PATH”```

Install Docker

$ brew install docker docker-machine
$ docker --version

Official documentation

Get Aizhan Smith’s stories in your inbox

Join Medium for free to get updates from this writer.

This will install the Docker engine, which will require Docker-Machine (+ VirtualBox) to run on the Mac.

If you want to install the newer Docker for Mac, which does not require virtualbox, you can install that through Homebrew’s Cask:

$ brew cask install docker

Also we have installed docker-machine as the docker is only a client and you cann`t run it natively on macOS.

On macOS the docker binary is only a client and you cannot use it to run the docker daemon, because Docker daemon uses Linux-specific kernel features, therefore you can’t run Docker natively in OS X. So you have to install docker-machine in order to create VM and attach to it.

If you want to install Docker-Machine manually:

$ curl -L https://github.com/docker/machine/releases/download/v0.16.1/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine
$ chmod +x /usr/local/bin/docker-machine

If you still don`t have VirtualBox :

$ brew cask install virtualbox
Press enter or click to view image in full size

How to create Docker-machine and run docker containers?

It will be in the next article!

See you soon!

P.S. But if you are curious and don`t want to wait, welcome to my github!

--

--