I finally have a beta invite for the native OSX version of Docker, well sort of native OSX version, as you can see from the quote below there is still a virtual machine running …
Faster and more reliable — No more VirtualBox! On Mac, the Docker Engine runs in an xhyve Virtual Machine (VM) on top of an Alpine Linux distribution. The VM is managed by the native Docker application. On Windows, the Docker Engine is running in a Hyper-V VM. You do not need Docker Machine (docker-machine) to run Docker for Mac and Docker for Windows.
… xhyve is a port of The BSD Hypervisor which takes advantage of the hypervisor framework provided by Apple meaning that Docker now has a very small footprint and access to alot of more of the native features of OSX.
Installing it is a breeze, like any other OSX application you download a dmg file, mount and then copy the application to your Applications folder;
Once you have the Docker application in your Applications folder it is time to launch it, doing so will prompt you to enter your beta invite token;
Once installed, it will check that the token is valid;
Clicking Next will pop-up a prompt which tells you that Docker needs your password to get escalated privileges;
Once Docker finishes configuring the network component and linking the Docker client to the new VM you should receive confirmation that Docker is up and running;
And thats its, you now have Docker up and running as natively as you can on a non-Linux machine, as per any new installation, lets run the Hello World container, running ….
docker run hello-world
…. gave me the following;
Now I had Docker installed it was time to test my biggest bug bear of running Docker with Virtualbox, file permissions !!! It has been one of the big selling points of this new more native version;
Volume mounting for your code and data — Volume data access is fast and works correctly.
A good test is trying to run MariaDB / MySQL container and have the /var/lib/mysql/ folder mounted as a volume from your local machine. If we attempted this with Virtualbox we would have to jump through all sorts of hoops to get it so that permissions are enough for MariaDB / MySQL to even start.
I used the following command to launch MariaDB using my own MariaDB image ;
docker run -d -p 3306:3306 — name=”database” -e MYSQL_DATABASE=wibble -v ~/Projects/permissions/database:/var/lib/mysql russmckendrick/mariadb
This would mount ~/Projects/permissions/database to /var/lib/mysql within the container, as you can see from the following terminal session, it worked flawlessly;
The MariaDB container is sat there happily making MySQL available on port 3306 on localhost meaning I can connect it using something like Sequel Pro with no drama at all;
I can even attach to the container as I would any other container;
All of this means that issues like 1.3.0 — Only root can write to OSX volumes / Can’t change permissions within #581 which has been open since October 2014 can be finally laid to rest.