Page 38 - MSDN Magazine, April 2017
P. 38
Figure 3 A Kibana Dashboard
Power users will quickly find their way around Kibana, and they’ll be able to make their own visualizations and dashboards without needing to involve IT. Without any downtime I’ve added self-service analytics to the application. The core of that feature comes from enterprise-grade open source software I’ve pulled from Docker Hub into my solution. The custom component to feed data into the document store is a simple .NET console appli- cation, with around 100 lines of code. The Docker platform takes care of plugging the components together.
Running Dockerized Solutions on Azure
Another great benefit of Docker is portability. Applications pack- aged into Docker images will run the exact same way on any host. The final application for this article uses the Windows Server and SQL Server images owned by Microsoft; the NATS image curated by Docker; and my own custom images. All those images are pub- lished on the Docker Hub, so any Windows 10 or Windows Server 2016 machine can pull the images and run containers from them.
Now my app is ready for testing, and deploying it to a shared environment on Azure is simple. I’ve created a virtual machine (VM) in Azure using the Windows Server 2016 Datacenter with Containers option. That VM image comes with Docker installed and configured, and the base Docker images for Windows Server Core and Nano Server already downloaded. One item not included in the VM is Docker Compose, which I downloaded from the GitHub release page.
The images used in my Docker Compose file are all in public repositories on Docker Hub. For a private software stack, you won’t want all your images publicly available. You can still use Docker Hub and keep images in private repositories, or you could use
an alternative hosted registry like Azure Container Registry. Inside your own datacenter you can use an on-premises option, such as Docker Trusted Registry.
Because all my images are public, I just need to copy the Docker Compose file onto the Azure VM and run docker-compose up –d. Docker will pull all the images from the Hub, and run containers from them in the correct order. Each component uses conventions to access the other components, and those conventions are baked into the Docker Compose file, so even on a completely fresh envi- ronment, the solution will just start and run as expected.
If you’ve worked on enterprise software releases, where setting up a new environment is a manual, risky and slow process, you’ll see how much benefit is to be had from Windows Server 2016 and the Docker platform. The key artifacts in a Docker solution—the Dockerfile and the Docker Compose file—are simple, unambiguous replacements for manual deployment documents. They encourage automation and they make it straightforward to build, ship and run a solution in a consistent way on any machine.
Next Steps
If you’re keen to try Docker for yourself, the Image2Docker PowerShell module is a great place to start; it can build a Dockerfile for you and jump-start the learning process. There are some great, free, self-paced courses on training.docker.com, which provisions an environment for you. Then, when you’re ready to move on, check out the Docker Labs on GitHub, which has plenty of Windows container walk-throughs.
In a Docker solution the Dockerfile and the Docker Compose file are simple, unambiguous replacements for manual deployment documents.
There are also Docker MeetUps all over the world where you can hear practitioners and experts talk about all aspects of Docker. The big Docker conference is DockerCon, which is always a sell-out; this year it’s running in Texas in April and in Copenhagen in October. Last, check out the Docker Captains—they’re the Docker equiva- lent of Microsoft MVPs. They’re constantly blogging, tweeting and speaking about all the cool things they’re doing with Docker, and following them is a great way to keep a pulse on the technology.n
Elton StonEman is a seven-time Microsoft MVP and a Pluralsight author who works as a developer advocate at Docker. He has been architecting and delivering successful solutions with Microsoft technologies since 2000, most recently API and Big Data projects in Azure, and distributed applications with Docker.
thankS to the following technical expert who reviewed this article: Mark Heath
26 msdn magazine
Containers