VMware AppCatalyst and Docker
This post is about VMware AppCatalyst a desktop hypervisor for developers released as a technology preview. The interesting part is unlike VMware Fusion for Mac, AppCatalyst is free. It also comes with a REST API and a simple CLI.
AppCataylst comes pre-bundled with PhotonOS which is a Linux distribution developed by VMware specifically as a container host. PhotonOS comes with Docker preinstalled. You can read more about PhotonOS here.
To Install AppCatalyst first get the installer from here https://www.vmware.com/cloudnative/appcatalyst-download. You will get a .dmg file, just complete the installation by following the instructions from the installer.
Once we complete the installation, open your terminal application to start creating vm’s. The CLI coming with AppCatalyst is very minimal and easy to use.
Create a VM based on PhotonOS and Run Docker containers
$ appcatalyst vm create dev1
Info: Cloned VM from '/opt/vmware/appcatalyst/photonvm/photon.vmx' to '/Users/athiyara/Documents/AppCatalyst/dev1/dev1.vmx'
In this step appcatalyst copies the photon.vmx file to in a location under the users home directory. Now power on the vm so that we can login and start playing with Docker.
$ appcatalyst vmpower on dev1
2015-10-24T12:48:58.219| ServiceImpl_Opener: PID 3103
Info: Completed power op 'on' for VM at '/Users/athiyara/Documents/AppCatalyst/dev1/dev1.vmx'
Now to login to the VM we will be using a preconfigured SSH Key Pair which is located in the appcatalyst installation location
$ ls /opt/vmware/appcatalyst/etc/
appcatalyst_insecure_ssh_key appcatalyst_insecure_ssh_key.pub
To get the IP Address of the VM,
$ appcatalyst guest getip dev1
172.16.248.139
Now we can login to the VM using the public Key available in the appcatalyst installation location. photon is the default user to login to the VM.
ssh -i /opt/vmware/appcatalyst/etc/appcatalyst_insecure_ssh_key photon@172.16.248.139
photon [ ~ ]$ cat /etc/photon-release
VMware Photon Linux 1.0 TP2
Now as you are inside the vm you can start using Docker. The Docker Deamon is preconfigured such that the photon user need not use sudo to run docker commands. Photon runs the latest version of Docker,
photon [ ~ ]$ docker version
Client:
Version: 1.8.1
API version: 1.20
Go version: go1.4.2
Git commit: d12ea79
Built: Thu Aug 13 02:49:29 UTC 2015
OS/Arch: linux/amd64
Server:
Version: 1.8.1
API version: 1.20
Go version: go1.4.2
Git commit: d12ea79
Built: Thu Aug 13 02:49:29 UTC 2015
OS/Arch: linux/amd64
photon [ ~ ]$ docker info
Containers: 0
Images: 0
Storage Driver: overlay
Backing Filesystem: extfs
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.0.9
Operating System: VMware Photon/Linux
CPUs: 1
Total Memory: 489.6 MiB
Name: photon
ID: NQDX:UQLC:4AYM:JKUV:KDES:J4AI:WETQ:KIEC:SJUP:NHKT:PS5O:4WVU
Now to just test the working of Docker lets pull a sample Docker image and run. Here we will use the busybox image.
photon [ ~ ]$ docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
bf0f46991aed: Pull complete
3d5bcd78e074: Pull complete
library/busybox:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:5551dbdfc48d66734d0f01cafee0952cb6e8eeecd1e2492240bf2fd9640c2279
Status: Downloaded newer image for busybox:latest
We will run a hello world using Busybox Image.
photon [ ~ ]$ docker run -it busybox echo "Hello World"
Hello World
photon [ ~ ]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
photon [ ~ ]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bb00976fd1ab busybox "echo 'Hello World'" 4 seconds ago Exited (0) 4 seconds ago angry_meitner
photon [ ~ ]$
Now you can work on more complex Docker Workflow using PhotonOS and VMware AppCatalyst. Enjoy!