Kitematic simplifies Docker installation for Mac and also provides an easy GUI interface to manage Containers. Recently, Kitematic released an alpha version for Windows. I tried this recently and I will share my experiences in this blog.
I had covered boot2docker in 1 of my earlier blog. Kitematic is boot2docker combined with a GUI for managing containers. Kitematic uses the same Linux VM as boot2docker.
After registering for Alpha program, I received the download link 1 day later. Kitematic loads a small Linux VM in Virtualbox over which the Container runs. If Virtualbox is not installed, Kitematic installation program also installs Virtualbox. In my case, I already had Virtualbox installed. When I tried installing, I got this issue:
I had faced similar issue when installing boot2docker. 1 of the workarounds I found by googling was to delete the host-only interface that Virtualbox creates for Kitematic/boot2docker. I already had 6 host-only interfaces created in my Virtualbox. I deleted 4 of them and tried reinstalling Kitematic and the installation went through after that.
The second issue I faced was with running Docker CLI and it complained that Docker client and agent versions did not match.This was because I had boot2docker installed previously in my Windows machine. I uninstalled boot2docker and Docker CLI worked fine after that.
Kitematic Networking is similar to Docker networking, the additional thing is that it creates a host-only Virtualbox interface. Following was the interface it created for me:
VBoxManage list -l hostonlyifs Name: VirtualBox Host-Only Ethernet Adapter #3 GUID: 937e35bc-a540-4bbf-b710-b36e753923c8 DHCP: Disabled IPAddress: 192.168.99.1 NetworkMask: 255.255.255.0 IPV6Address: fe80:0000:0000:0000:3862:e5a5:b806:2fa4 IPV6NetworkMaskPrefixLength: 64 HardwareAddress: 08:00:27:00:c0:67 MediumType: Ethernet Status: Up VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter # 3
We can login to the boot2docker host using the following environment variables. These environment variables are automatically set in the window where Docker CLI window is opened.
DOCKER_CERT_PATH=C:\Users\..\.docker\machine\machines\kitematic DOCKER_HOST=tcp://192.168.99.101:2376 DOCKER_TLS_VERIFY=1
To ssh to the Linux Kitematic/boot2docker host, we can do this:
ssh -i .docker/machine/machines/kitematic/id_rsa firstname.lastname@example.org
Following default interfaces gets created in the linux host. Containers gets created in docker0 network, eth0 is used for external connectivity, eth1 is used for talking to host using the host-only network.
docker0 Link encap:Ethernet HWaddr 52:88:04:42:D7:2B inet addr:172.17.42.1 Bcast:0.0.0.0 Mask:255.255.0.0 inet6 addr: fe80::986e:7cff:fe08:3b5b/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1347 errors:0 dropped:0 overruns:0 frame:0 TX packets:1773 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:2402125 (2.2 MiB) TX bytes:230554 (225.1 KiB) eth0 Link encap:Ethernet HWaddr 08:00:27:E1:19:DA inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fee1:19da/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:363899 errors:0 dropped:0 overruns:0 frame:0 TX packets:121508 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:341405145 (325.5 MiB) TX bytes:7802761 (7.4 MiB) eth1 Link encap:Ethernet HWaddr 08:00:27:71:FA:7D inet addr:192.168.99.101 Bcast:192.168.99.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe71:fa7d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:33314 errors:0 dropped:0 overruns:0 frame:0 TX packets:23371 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4147681 (3.9 MiB) TX bytes:9959823 (9.4 MiB)
Docker CLI can either be accessed from Windows host or inside Linux boot2docker host.
Following are some things I tried:
- I was able to access public container images from Dockerhub as well as container images that I have uploaded. Using these images, I was able to create Containers. I tried hello-world nginx container and few others.
- Tried the docker cli using the option available in GUI.
- Settings option in the container gives information like environment variables, mount volumes etc.
- Using mount volumes, I tried changing the index.html from my host machine and saw it getting updated in real-time.
- Container logs are useful to debug issues.
- Web preview are useful in seeing the end result.
- We can restart, stop and delete containers from the GUI.
Trying a multi-container application using Kitematic:
Typically, applications would consist of multiple containers and we would need to link the containers to create an application. Typical example is a WordPress web container using mysql db for the backend. I could not find a way to directly create a multi-container application from Kitematic. I was able to create the multi-container application from Docker CLI and Kitematic was able to display it correctly.
Following is an example of 2 container WordPress application using Docker CLI using Container linking.
docker run --name some-mysql1 -e MYSQL_ROOT_PASSWORD=mysql -d mysql docker run --name some-wordpress1 --link some-mysql1:mysql -d -p 8081:80 wordpress
After this step, Kitematic displayed both the Containers. The linking part and port mapping part does not get displayed. On successful creation, Kitematic displays the web preview and access URL using which WordPress can be accessed.
Following is another approach of creating the same 2 container WordPress application using environment variables and Docker CLI. In the approach below, we need to find the IP address of DB container and use it in WordPress container.
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=mysql -d mysql docker run --name some-wordpress -e WORDPRESS_DB_PASSWORD=mysql -e WORDPRESS_DB_HOST=172.17.0.15:3306 -p 8080:80 -d wordpress
We can see the environment variables MYSQL_ROOT_PASSWORD, WORDPRESS_DB_PASSWORD and WORDPRESS_DB_HOST in Kitematic settings->environment variables. I was not able to create and save environment variables from Kitematic.
Issues and Enhancement requests:
Kitematic is a great way to get Docker beginners to get hooked on to Docker. For Windows users, this gives an easier option to try out Docker without going through Linux installation process. In the current form, the functionality is very limited. Following are some fixes and enhancements that I think are needed.
- Not able to remap Container ports to host machine.
- Container environment variables like ip address will be good to display
- Addition of environment variables not working. Even though I was able to add, I could not save them.
- Will be good to give access to linux host where container is run like exec option where Container shell is given.
- Creation of Multi-container application is not possible currently. Even a simple approach using environment variables, container linking is not working.
- Need an option to have multiple hosts where Containers can be deployed. Integration with Docker machine can achieve this.
- Integrate with docker swarm and compose
- Kitematic for Linux would be useful.
- Minor point. To go back to home screen, the only option I see is to select “New”, good to have a Home button.
I have raised a github case for tracking the above requests.