docker-machine the easy way of administration

The docker-machine command offers very cool features in order to operate with Docker images/container. The first basic features I would like to present in this tutorial.

Preconditions

Preparation

The output should now resemble the following example:

Start and access Docker container

docker-machine access container

… a little hint …

docker-machine xterm

… leave container without stopping …

docker-machine leave container

Copy files

docker-machine copy

How cool is that?

Vim syntax highlighting for Dockerfiles

By default Vim offers on the Mac OS X no syntax highlighting for Dockerfiles. With a few steps you can change that. At the end of this tutorial you can also install additional PlugIns!

Prepare .vimrc

Install and enable PlugIns

Share Docker Images and Container

If you want to test dockerized applications, you need to export/import Docker images or Docker containers. Therefor Docker offers various options and commands. In this tutorial i show some possibilities without Docker Hub or Docker registry.

Preconditions

Docker save and load

Docker export and import

Attention: Please note each output for “$ docker history…” !!!!

Create REST API mock server with Docker

This time again a tutorial with various instructions. It is a REST API services for development and testing purposes and some simple Docker instructions.

Preconditions

Note: For Mac OS X and Windows use Docker Toolbox!

Create and connect into Boot2Docker VM

Create Dockerfile (inside VM)

Create Docker image and container (inside VM)

Run application in browser

Now open a browser and call URL like: http://<192.168.99.100>:8888/__manage. You can now begin to create and use REST API resources.

Expand Boot2Docker – Part2

The configuration of the Boot2Docker VM, still has a few drawbacks. You can not permanently store, the root password must be set again, SSH keys always changing … and so on. In this part we will change that.

Preconditions

Create and connect HDD

Prepare disk

Set permanent root password

From this point, you can connect via SSH as root user.

Create Boot2Docker VirtualBox VM

Boot2Docker is perfect to test Docker Images/Container. This guide shows the fastest and easiest way to create a Boot2Docker VirtualBox VM.

Preconditions

Download Boot2Docker ISO

Download the necessary ISO Version from GitHub. In this tutorial I use the “Default Machine Folder”.

Boot2Docker Release

Prepare and start VM

SSH into running VM

If all goes well …