WTF is a container?
Hi there, good day fellows<p>I was expecting this kind of thread long ago, thanks guys for sharing your concerns, I am learning a lot from them!<p>IMO we can&#x27;t compare containers vs VMs like many are doing now - and I was too when first heard about Docker and containers.<p>I hold almost all VMware certs (VCP&#x2F;VSP&#x2F;VTSP for 3.1&#x2F;4.x&#x2F;5.x and VCDX), I sign the 3 major VMware P2V migrations in BR&#x2F;LA (287 P2Vs in 2005, 1600&#x2F;2008 and 2500&#x2F;2011). I was REALLY into VMware from 2000 to 2010, so I feel confident using it and recommending to many environments. I even manage some of them still today.<p>When we clone or migrate a physical machine to virtual, or whenever deploying a VM from scratch (or even using templates or copying VMdks etc) into production, we aim to develop the environment in order to see it lasting &quot;forever&quot;. We want this to be flawless, because even with given most-players virtualization deploying resources (hyper-V, VMware, xen, kVM, vbox+vagrant, etc), nobody wants to troubleshoot a production environment, we cheer to see the VMs always up and running. I remember when P2V in mentioned projects during the night, and needed to fallback physical servers because the cloned VM didn&#x27;t behaved accordingly. Please VMware, clone it ok, otherwise the troubleshoot for legacy shit will be a pain.<p>On the other side, containers are made to be replaced. They are impermanent. 
You can tune your images as your app&#x2F;env needs. You can have an image for each service you have.
You can have many images running many containers, and some of them providing services you have.
You are able to customize an image in a txt file called Dockerfile, and generate an image from this file.<p>So imagine we got this infrastructure to &quot;Dockerize&quot; , a website with a DB.
Does your webserver runs apache? so you can code a Dockerfile, that will deploy an apache instance to you.
It could deploy FROM an ubuntu:16.10 or 10.04, depends on what is better for your app.
OR, we could just pickup Apache&#x27;s own image, like in FROM apache. 
You can save this image as yourid&#x2F;apache. And you can do the same regardless of what DB you are using, 
just install it (the mysql using apt-get in a FROM ubuntu&#x2F;debian based system), or use mysql images directly. 
You are able to publish the website cloning your site dev repo direct in Dockerfile itself, or you could have
the website at some dir in your host, using ADD or CP to make it available in the right container dir (eg &#x2F;var&#x2F;www&#x2F;)
You could even use Volumes, to mount some host dir (or a blob, or a storage account, or a partition in your storage, something available 
in the host itself). This is specially interesting for DB in my opinion. Once you have your Dockerfile ok, you can name it yourid&#x2F;db.<p>And if you have a main website, and a blog website, you could use the same apache Dockerfile changing only the git clone line, and
save them as yourid&#x2F;apache:website and yourid&#x2F;apache:blog for example.<p>And when redeploying the container, you will have the same volume data available in the same container dir. Even if you redeployed it
from ubuntu:15.10 to ubuntu 16:10.You can use the latest improvements from the freshest image (or patching some vuln), and redeploy all your containers that uses this same image at once.<p>The same goes on, you can test jenkins without knowing what OS jenkins image is made off. 
You dont have to worry about it. It will just work. You pull the image and run the container and voila.<p>NOW, my Docker instances are like this: I use Docker-machine, and locally I got the default and local envs. 
I got also an Azure instance at Docker-machine (that runs on Azure), and another instance configured in Docker-cloud using Azure as cloud provider (I use Azure due bizspark credits). So, 4 of them. All those instances, are VMs themselves. Ubuntu VMs to be sure.<p>You just replace the container (probably published in a cluster if you care enough your prod env). Not the same as with VMs at all.<p>I see Docker as a hypervisor for containers the same way VMware and hyperv are to VMs.<p>So I understand my Docker hosts VMs have the same HA, failover, load balance, resources allocation, and so many resources VMs have.
I use Docker on those VMs to make easy deploys, images, tune images, really guys I was the VMware guy for so long, I went just crazy in the resources Docker gives to us.<p>Docker has many weak points indeed (NAT networking, privileged containers must be run sometimes, security concerns, etc), but again, I don&#x27;t see Docker to be erasing VMs from my life and now on I can deploy everything that will run happy forever in containers. We still need HA, failover, load balance, resources allocation and so on. Docker needs to be used together with TOOLS that allows it to run smoothly, and allows us to maintain our environments easier.<p>One of those tools are containers clusters. I work mostly with Google Kubernetes, but there are other as Docker Swarm, Apache Mesos, DCOS... Azure has its Azure Container Services ACS, IBM has its BlueMix containers, etc.  Using a cluster and a deploy methodology, you are able to deploy your containers in different namespaces such as DEV &#x2F; STAGING &#x2F; PROD. You can use a BUILD environment to read your Dockerfile, build the image and deploy containers to the namespace you need. You can configure this build to trigger with a commit in the git repo for exemple.<p>So lets say we have a developer, and he needs our yourid&#x2F;apache:website to be deployed, with the new website version. 
If the website is already updated in your git repo, you just clone it. The Dockerfile would look like this:<p><pre><code>  FROM apache
  MAINTAINER Your Name &lt;your@email.com&gt;
  WORKDIR &#x2F;var&#x2F;www&#x2F;
  RUN git clone https:&#x2F;&#x2F;github.com&#x2F;yourid&#x2F;website&#x2F;website.git .
  EXPOSE 80
  CMD [&quot;&#x2F;run.sh&quot;]
</code></pre>
This would be named as website.Dockerfile. If you change the project git repo to any of your other sites that runs on apache, you can SAVE AS other.site.Dockerfile, and always deploy this service from this specific repo.<p>You can customize your Dockerfile of course and add support to specific codes like installing PHP, Ruby, Python, etc. 
You could even use Configuration Managers (CMs) as Ansible, Salt, Chef, Puppet, juju etc to apply those changes.<p>Lets say we will start the build now. We are developing this image together. So I just changed my git url on the Dockerfile. 
When we commit, the autobuild triggers this build in our build system (in my case, Docker-cloud or jenkins). 
This is what Continuous Integration (CI) and Continuous Deployment (CD) are about.<p>So when build is triggered, it gets the Dockerfile from the repo, builds from its image, deploys the container in the namespace you wanted (our case, DEV). This service could be published as website.dev.mydomain.com for example. Same concerning to staging namespace. And to www.mydomain.com when ready to production, in the PROD kubernetes namespace for example. Kubernetes is a distributed thing, so you could have minions (nodes) splitted across different datacenters, or geo locations. This pretty much reminds me of VMware VMs running inside VMfs storage made available through a set of ESXi servers, all with access to the same luns&#x2F;partitions&#x2F;volumes.<p>This is just my point of view, so please feel free to comment and ask me anything.<p>Please, just dont blame Docker because you aren&#x27;t aware of mainstream techs available nowadays. If you are comparing Docker to VMs, or SSHing inside the containers, and often mad cause your data vanished while redeploying your Docker Containers, believe me you are doing it wrong.<p>Being a pioneer is often the same: in the 90s we had to explain why Linux was good for the enterprise, in the 2000&#x27;s we had to prove VMware was really going to cluster your legacy systems, and now we have to explain what&#x27;s possible to do with Docker. And, as the tech is new (I know there were previously solaris zones, google borg, etc), but I see Docker will mature its features relying in other tools (and even copying features from k8s to Swarm eg). Docker is just one skill needed to run your stuff.<p>Cheers!<p>M Matos
<a href="https:&#x2F;&#x2F;keybase.io&#x2F;mmatos" rel="nofollow">https:&#x2F;&#x2F;keybase.io&#x2F;mmatos</a>