If you are a fan of Containers (Docker especially) like me, Azure is making sure that it has the same love as you and me.
Apart from initiatives like CoreOS (which I believe is the best that could've happened to Azure from the containerization stand-point), Container apps are one more way to start with a Dockerized app pre-installed with a VM the moment you start with it.
Lets see how to make and use a container app, but before we do that I need you to learn about Azure Resource Manager Templates, do take some time out if you really want to understand the story of how it works ? Here are a few links to start you with Azure Resource Manager or ARM Templates as they popularly call it
- Azure Resource Manager template Basics - http://mitchdenny.com/what-is-azure-resource-manager/
- Github Repo of Azure templates - https://github.com/Azure/azure-quickstart-templates
- A full blown video about ARM templates - https://channel9.msdn.com/Events/TechEd/NorthAmerica/2014/DEV-B224#fbid=
Even if you don't know about ARM, don't get intimidated with the concept and a big repo, its just a template format by which you can deploy multiple resources (VM's, databases e.t.c) in one go, that's it, with a lots of bells and whistles when you actually get to know the entire concept.
I would start with creating a Containerized VM which has got a MongoDB running in Docker inside it
- Go to Portal.azure.com and click on 'New', and select 'Container App', Select 'MongoDB'
- In the next window, click on 'Create' - which will prompt you for settings to create a new virtual Machine, Selecting the VM size, Settings related to storage account and Network and Finally a review Summary
Click create in Review summary, and a VM will start deploying.
- This VM as you see can be accessed by a public port using ssh, what's great about this VM is it comes with a pre-installed Docker , and a Dockerized running MongoDB Image.
4. Lets now SSH into this VM (using the public IP Address) and see if we have a running mongo docker image in it
- Voila! We have a running mongo that you can connect with, but since you have the mongo running inside docker and you don't have a client on your azure machine, you won't be able to do a command like mongo unless you install the mongodb client using the command
# apt-get install mongodb-clients
You can't possibly ssh into this docker image because the only open port is 27107 so install your client and go ahead connect with it like
# mongo localhost -p 27017
Awesome! Now you have a Dockerized Mongo running inside your VM.
What if you want to boot up with a rather complex container system which contains more than one container images, like you want nginx and mongo both installed in one go, the templates that you see in container apps are actually one platform in a container getting deployed at the server, if you want a rather complex one you need to create your own customized deployment; That we'll cover in our next blog post.