Click here to Skip to main content
15,883,705 members
Articles / Containers / Docker
Article

Getting Started with Docker on Alibaba Cloud

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
4 Jan 2018CPOL5 min read 3.8K   3  
This article explains what Docker is, and how to get started using it via Alibaba Container Service.

This article is a sponsored article. Articles such as these are intended to provide you with information on products and services that we consider useful and of value to developers

Alibaba Cloud provides a comprehensive suite of global cloud computing services to help power and grow your business. Create an account today and get $300 in new user free credit.


Containerization is taking over the world, and Docker is the leading technology being used by nearly every major company.

This article explains what Docker is, and how to get started using it via Alibaba Cloud Container Service.

A Brief Explanation of Docker

But what exactly is Docker?

In a nutshell, Docker is a platform for programmatically creating, managing, building, and deploying containers. For the uninitiated, containers are OS-level virtual services that allow you to run an application and its dependencies in isolated processes. While this might sound confusing, the long and short of it is that containerization allows you to isolate resources and their dependencies from each other.

The benefits of containerization (beyond simply isolating resources) are that they sandbox applications, provide a consistent runtime environment, reduce the physical footprint of each process, and offer a low—programmer-friendly—overhead. While they're not perfect for everything (though I wouldn't admit as much to the containerization advocates of the world), they are an excellent way to reduce cost in both infrastructure and resources.

Launching Your First Container

"So…Docker is great," you might be thinking, "but how do we actually go about launching our first container (on Alibaba Cloud)?"

Image 1

To get started with Docker on Alibaba Cloud, the first thing we need to do is navigate to the Container Service dashboard. This dashboard can be found under the Elastic Computing section on your Alibaba Cloud Console.

Create the Cluster

Once there, we then need to create a cluster. A cluster is a collection of nodes—the things the containers run on—that can be scaled up or down to meet the infrastructure demands of an application. To do this, click on the Create Cluster button from within the Container Service Overview tab:

Image 2

That button will take you to the cluster creation wizard. For the purposes of this demonstration, all of the default values will be fine, however one thing worth paying attention to is the Password field that appears towards the bottom of the page. It is required, however, it can be easily overlooked since it falls under the fold.

Image 3

Once you request a cluster, Alibaba Cloud will go about provisioning the resources necessary to run it. This includes load balancers, virtual machines, routers…basically everything required to run your own Docker cluster. Take special note of the Reminder shown at the top of the confirmation page. The load balancer requires the Resource Access Management (RAM) service to be set up before it will work.

Image 4

Deploying a cluster can take some time, but once it's all finished, head over to the Clusters tab in the Container Service dashboard. Here, you will see your new node, the status, and any other information associated with it:

Image 5

Create the Application

So we have a cluster…Now what?

The cluster is the basic infrastructure required to actually run Docker containers on Alibaba Cloud. Once provisioned, we can create an application. To do this, navigate to the Applications tab in the Container Service dashboard and click on the Create Application button:

Image 6

The Basic Information tab of the application creation wizard is fairly self-explanatory. The two most important fields for this example are the name and cluster (hint: the thing we just created above).

Image 7

After setting the basic application information, we can now get into the meat of things. While you can use any private or public Docker base image, for the purposes of this demo, let's select one of the pre-provided Docker images. To do this, click on the Select Image link:

Image 8

This link will bring up the Image Selection modal, which will allow you to browse popular and official Docker images. To make the demonstration as clear as possible, let's go with wordpress:

Image 9

The WordPress image will automatically define some necessary information within our application (environment variables, ports, etc), but one thing that we will have to do is open our application up to the web. To do this, create a Web Routing entry with a Container Port of 80 and a domain. If you do not specify a specific domain, but instead choose a subdomain (as in the screenshot below), then a domain name will be generated for you:

Image 10

Once you create your application, head back to the Applications tab in the Container Service dashboard. Here, you'll see the new application you deployed:

Image 11

Verifying the Application

To verify the installation of your application, click on the application name in the Applications tab. This will take you to an overview of the containers running within the application. Take special note of the Access Endpoint, as this is the domain name that is generated for your application based on the subdomain defined above:

Image 12

Clicking on the Access Endpoint will open up a new tab in your web browser to the application you created and opened up to the Internet at large. As you can see below, WordPress has been successfully installed via the Alibaba Cloud Container Service and is awaiting configuration:

Image 13

Conclusion

All-in-all, the Alibaba Cloud Container Service is an incredibly straightforward and easy service to use. While there are some nuances that can be confusing at first, this is a problem that is common with Docker as a platform, rather than Alibaba Cloud itself. Despite the simplicity of this demonstration, it should also be noted that Alibaba Cloud Container Service has some excellent functionality around auto-scaling applications as load increases or decreases, and is a great solution for quickly spinning up new Docker containers with very little overhead.

If you’d like to give Alibaba Container Service a try for yourself, you can take advantage of Alibaba Cloud’s current offer of $300 in free credits.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
Zachary Flower (@zachflower) is a freelance web developer, writer, and polymath. He has an eye for simplicity and usability, and strives to build products with both the end user and business goals in mind. From building projects for the NSA to creating features for companies like Name.com and Buffer, Zach has always taken a strong stand against needlessly reinventing the wheel, often advocating for the use of well established third-party and open source services and solutions to improve the efficiency and reliability of a development project.

Comments and Discussions

 
-- There are no messages in this forum --