Docker For Mac 17.06 CE edition is the first Docker version built entirely on the Moby Project. In case you’re new, Moby is an open framework created by Docker, Inc to assemble specialised container systems. It comprises of 3 basic elements: a library of containerised backend components (e.g., a low-level builder, logging facility, volume management, networking, image management, containerd, SwarmKit), a framework for assembling the components into a standalone container platform, and tooling to build, test and deploy artifacts for these assemblies and a reference assembly, called Moby Origin, which is the open base for the Docker container platform, as well as examples of container systems using various components from the Moby library or from other projects.
Docker for Mac is a Docker Community Edition (CE) app and aims for a native OSX experience that works with existing developer workflows. The Docker for Mac install package includes everything you need to run Docker on a Mac. Few of the attractive features it includes:
- Easy drag and drop installation, and auto-updates to get latest Docker.
- Secure, sandboxed virtualisation architecture without elevated privileges.
- Native networking support, with VPN and network sharing compatibility.
- File sharing between container and host: uid mapping, inotify events, etc
The core building blocks for Docker for Mac includes –
Some notable components include:
- HyperKit, a toolkit for embedding hypervisor capabilities in your application
- DataKit, a tool to orchestrate applications using a 9P dataflow
- VPNKit, a set of tools and services for helping HyperKit VMs interoperate with host VPN configurations
source ~ Docker Inc.
If you want to learn more details about these components, this should be the perfect guide.
LinuxKit today support multiple Cloud platforms like AWS, Google Cloud Platform, Microsoft Azure, VMware etc. In terms of Local hypervisor, it supports HyperKit, VMware, KVM and Microsoft Hyper-V too.
If you have closely watched LinuxKit repository, a new directory called blueprint has been introduced which will contain the blueprints for base systems on the platforms that will be supported with LinuxKit.These has been targeted to include all the platforms that Docker has editions on, and all platforms that Docker community supports. All the initial testing work will be done under examples/ and then pushed to blueprints/ directory as shown.
Currently, the blueprint/ directory holds essential files for Docker For Mac 17.06 CE –
- base.yml => which contains the open source components for Docker for Mac.
- docker-17.06.ce.yml => necessary YAML file to build up VM Image
The blueprint has support for controlling
dockerd from the host via
vsudd and port forwarding with VPNKit. It requires HyperKit, VPNKit and a Docker client on the host to run.
The VPNKIT specific enablement comes from the below YAML code:
Use the Moby tool to build it with Docker 17.06:[simterm]
$moby build -name docker4mac base.yml docker-17.06-ce.yml
This will produce couple of files under docker4mac-state directory as shown below:
Next, we can now run the LinuxKit command to run VM with 1024M disk[simterm]
$linuxkit run hyperkit -networking=vpnkit -vsock-ports=2376 -disk size=1024M docker4mac
By now, you should be able to see docker4mac VM booting up smoothly:
You can open up a new terminal to see the overall directory/files tree structure:
Let us try listing the service containers using
ctr containers ls command. It should show up Docker For Mac 17.06 service container as shown below:
ctr tasks ls command to get the list of service containers:
Now its easy to enter into
docker-ddm service container with the below command:
$ctr exec -t –exec-id 861 docker-dfm sh[/simterm]
You can verify further information with
docker info command:
How to connect to
docker-dfm` from another terminal?
Using another terminal, it is pretty easy to access docker via the socket
guest.00000948 in the state directory (
docker4mac-state/ by default) with the below command:
docker -H unix://docker4mac-state/guest.00000948 images
Let us create a Nginx docker container and see if it is accessible from Safari browser:
Did you find this blog helpful? Feel free to share your experience. Get in touch @ajeetsraina.
If you are looking out for contribution/discussion, join me at Docker Community Slack Channel.
Know more what’s happening in LinuxKit project by visiting this link.