Mechanical Shark

Hickory Dickory Docker, Part 2
In which we achieve BMD (Bare Minimum Docker).

Hickory Dickory Docker, Part 2
In which we achieve BMD (Bare Minimum Docker).

Ok, today I'm attempting the venerable "Hello World" in Docker for Mac, having only skimmed the instructions...

  1. Download the Docker installer, click it, drag the whale icon thing to the Applications folder icon thing. (You'll probably have to create a Docker ID to download it - keep it. You'll use it a lot later.) 
  2. Open the Applications folder in Finder, click the Docker app. Panic during the brief interlude with the spinning beach ball of death. A Tiny Whale icon appears in the notification area. You are prompted to enter/create your Docker ID. Probably.
  3. Look at Tiny Whale. Wonder what the hell you do next....

[OVERSIMPLIFICATION WARNING] Docker makes software portable. You see people comparing Docker images to CDs and game cartridges, etc, but it's more than that. It's like a CD you can play in your tape deck or your SNES or your record player or your lawnmower... as long as that lawnmower runs Docker.  People will want tell you things about virtualisation and shared kernels and file systems and stuff, but right now we don't care. Right now Docker is magic.

Docker software comes as an "image" (which contains the software, libraries, settings, etc). Docker allows you to run that image on anything with Docker installed. The running instance of the image is a called a "container".

At the moment, there are no images on my Mac. How can I tell? First, I fire up a Terminal because apparently it's still 1978. (Make sure you set it to with black with green text for the full effect.)

$ docker info




Containers: 0

Running: 0

Paused: 0

Stopped: 0

Images: 0




[snip]

Boring. So I need to get an image I can run. Luckily, whatever the default Docker repository is (Docker Hub? Probably.) has a "Hello World" image for just such an occasion. It's called "hello-world".

$ docker run hello-world




Unable to find image 'hello-world:latest' locally

latest: Pulling from library/hello-world

9bb5a5d4561a: Pull complete

Digest: sha256:3e1764d0f546ceac4565547df2ac4907fe46f007ea229fd7ef2718514bcec35d

Status: Downloaded newer image for hello-world:latest




Hello from Docker!




This message shows that your installation appears to be working correctly.




To generate this message, Docker took the following steps:

1. The Docker client contacted the Docker daemon.

2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 
  (amd64)

3. The Docker daemon created a new container from that image which runs the

   executable that produces the output you are currently reading.

4. The Docker daemon streamed that output to the Docker client, which sent it
 
  to your terminal.




To try something more ambitious, you can run an Ubuntu container with:


$ docker run -it ubuntu bash

This is vaguely reassuring, if not terribly impressive. It downloaded an image, spun it up into a container and ran the executable inside. You can run the "ambitious" option* it suggests ("docker run -it ubuntu bash") and this will download and spin up the Ubuntu bash shell. Which gives you a different prompt to play with.

Yay.

So far so good, but this is all far too command line-y for my tastes. Tiny Whale's dropdown (on the Mac version at least) has a link for Kitematic, which seems to be a fairly nifty GUI. Trying that next...

Why are we doing this? See Part 1

* Bonus reading: Literally the fourth docker container I ever ran was Docker DOOM, which (with a bit of legwork) let me shoot the third container to death with a shotgun.

Photo by Ghost Presenter from Pexels

Posted Saturday, July 7, 2018.

NEXT: Planned Obsolescence

PREVIOUS: Hickory Dickory Docker

Noobing containers, a personal "journey".

Field test

The future of Future Sound Of Disco.

Confession

2K18 -> 2K19

Anti-social networking

Sell your eyeballs direct!

A random deployment.

Or, "I am starting a music blog."

A Lack of Focus.

Or, "It ain't like it used to be."

TinyPNG

Automated image compression utility

Experimental antique imaging.

Or, "Capturing 8-minute-old photons with a 30-year-old camera."

Late nite, early warning.

Or, “Is this thing on?”

Purveyors of splendid IT solutions.

Est. 2013, London.

Company registered in England and Wales No 8696863.

Purveyors of splendid IT solutions.

Est. 2013, London.

Company registered in England and Wales No 8696863.

Previously

The long wait for long form.
Or, "I have decided to resurrect the blog, guv"

Archived Posts