Join Lynn Langit for an in-depth discussion in this video Using Docker and Container Engine, part of Google Cloud Platform Essential Training.
- View Offline
- In addition to Compute resources on the Google Cloud that are either partially managed with Google App Engine, or fully managed with Google Compute Engine virtual machines, there's a new game in town, and that's called Docker. In essence, Docker is the ability to have virtualization set at the level of an application rather than at the operating system. From a practical point, it allows you to have more instances of an application, so more websites, more databases, without installing an operating system, whether it be Linux or Windows or whichever, over and over and over.
Because of this, it allows for scalable applications that can scale up or scale down much more quickly than applications built on traditional virtualization, much more lightweight and, of course, running on the cloud, much cheaper. So it's really taking the entire cloud industry by storm. Now interestingly, as with many other of the cloud technologies that have been implemented by various vendors, Google itself is one of the primary authors of this technology. There are other open-source contributors, but Google has been using this containerized or Docker technology to run their own infrastructure for years.
The first place I'd recommend you'd go is to Docker itself. Docker is a set of open-source projects and a commercial company. The commercialization is around templates, tools, support, and training. You can use Docker at its core for free but many enterprises work with the Docker organization or other companies that support containerized implementations to have enterprise-type support. I like this picture because it really shows, in the simple way, why so many people are interested in implementing this type of virtualization.
In the old or the current world of virtual machines, you can see, we have to install a guest OS each time we want to have another instance of an application. In the new world of containers in Docker, it's obvious how much more lightweight our applications can be because you can see there's only one operating system. On top of that, you've got something called the Docker Engine which is a replacement for the Hypervisor that's used in virtual machine technology. Now, to get started with this, and I do recommend that you take a look at it, if you go to docs.docker.com, you can see the steps written out very clearly here so that you can install Docker.
If you're working with Google Cloud services that support Docker, or containers, you'll need to have these prerequisite steps setup. Google has documentation, but I find the documentation at Docker is actually clearer. So, you just install Docker and then you run a software image in a container, or you can look for an image on their public registry which is called Docker Hub, it's a great way to start. Once you understand a bit more about images, you can create your own image and run that in a container, you can actually take that image and you can register it as a publicly-available image on the Docker Hub, or you can just have a local repository.
Let's take a look at the Docker Hub Registry. You can see inside of here, it's a search engine for Docker images. A lot of people watching are probably familiar with WordPress, so let's take a look at the WordPress Docker image. One of the most interesting aspects of looking at this is how many people have already downloaded it. 2,400,000 and more have downloaded this Docker image so clearly there's some momentum here. Now, if we'd look inside of this, because this is familiar to a lot of people watching, you can see that we have various libraries associated to this, and then we talk about WordPress, and then it tells you how to use the image.
This is one of the beautiful things about Docker, once you have the image, which is just a text file, it's a standardized format which describes the components that are going to be part of the application virtualization. So in the case of WordPress, of course we'd have a front end and we'd have a MySQL database. Once you have that text file, that Docker, that container image, and the Docker client, literally, you type docker run, and then WordpPess, and then MySQL, and your WordPress instance is setup. It's really very, very simple. If you want another one, you can just run the other command, or you can actually set the number of instances that you want.
And again, you don't install the operating system over and over and over. That's the beauty of working with containerized application virtualization. Now, this technology, in terms of being a commercial offering, is new to all the commercial cloud vendors, even Google. So at the time of this recording, if I go over to the console and I click on Compute, and I go into Container Engine, the two capabilities that they've exposed through the console are both in Beta, those are clusters and the registry. So if you're using this functionality, be sure to check the documentation for the Google Cloud Container Engine service as this technology is fast-emerging.
And for the Google Cloud, in order to work with groups of Docker containers, in other words, to group them together and scale them up, scale them down, there is a set of management standards called Kubernetes. When you use Kubernetes, be sure to consult the Google Cloud documentation.
- What is Google Cloud Platform?
- Saving time and money with cloud services
- Understanding billing
- Enabling services and APIs
- Planning deployments
- Using compute services
- Storing data with Cloud Storage, Cloud SQL, BigQuery, and more
- Using networking, monitoring, and prediction services
- Finding tools to work with the Google cloud
- Implementing Google cloud solutions