Installing Docker (Mac)

Docker_install_Mac

This evening I have started some training on LinkedIn Learning about Docker. Docker is software that allows for software to be placed in virtual containers containing the software and all its dependencies. Unlike virtual machines which virtualise the hardware and contain an operating system, a container runs just above the host operating system. Docker containers are generally much smaller than virtual machines.

The Docker Desktop installation dmg for MacOS X can be found at:

https://store.docker.com/editions/community/docker-ce-desktop-mac

A Docker account is needed to access the download file, at time of writing (November 2018) this account is free. With the dmg downloaded and opened we need to drag and drop Docker.app onto the Applications folder.

Docker_install_Mac
Docker_install_Mac

docker_mac_copy.png

The copying takes a few moments, and as the application has been downloaded from a 3rd party (i.e. not Apple Store) website it gives a warning on first launch.

docket_mac_warn.png

After choosing “open” Docker greets us with a welcome whale and then asks for elevation (it needs the MacOS account password).

docker_welcome.pngdocker_priv.png

With all that out of the way, Docker is installed and ready to run. Docker places a docker whale icon onto the Mac OS task bar and asks for the Docker account information, this is the same Docker account created to download Docker.

docker_mac_logon.png

docker_mac_logged_in.png

Docker provides an install guide for Docker on MacOS at:
https://docs.docker.com/docker-for-mac/install/

What Next?

With Docker installed and logged into your Docker account, we can open up Terminal and check that everything is working. At the terminal prompt type:

docker –version

And this should return the Docker version/build that is currently installed, in my case this is version 18.09.0 build 4d60b4.

docker_mac_terminal_version.png

As Docker is new to me, it is time for the standard “Hello World!” to see how it works.

At the terminal prompt type:

docker run hello-world

docker_hello_world_mac.png

As Docker could not find the “hello-world” image locally (i.e. on my Mac) it contacts the Docker daemon which then searches the Docker Hub, finds the latest “hello-world” image, downloads it, then creates a container to run it in and outputs the “Hello from Docker!” message via the Docker client into the terminal session.

As the above screen shot indicates, Docker can be used to run an Ubuntu (Linux) BASH session via Mac OS Terminal, via the following command:

docker run -it ubuntu bash

ubuntu_container_on_mac.png

The uname -a is a BASH command that outputs information about the machine, operating system and kernel.

Docker provides a “Getting Started” guide at:

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

Docker containers use commands in the following format:

docker container COMMAND

docker_container_command.png

To see what can be run in a container visit https://hub.docker.com/explore/ 

I’m going to give Docker a whirl and see what I can do, hopefully I will follow up with a new blog post soon.

2 thoughts on “Installing Docker (Mac)

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.