Getting Started with Docker on Alibaba Cloud

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

TE_001

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)?"

01

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:

02

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.

03

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.

04

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:

05

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:

06

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).

07

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:

08

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:

09

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:

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:

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:

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:

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 credit.

Bio

14

Zachary Flower (@zachflower) is a Fixate IO Contributor and lead developer at Emerson Stone, a Boulder-based design and branding agency. 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.

目录
相关文章
|
Java 测试技术 微服务
这可能是2023年把微服务讲的最全了:SpringBoot+Cloud+Docker
最近几年,微服务可谓是大行其道。在业务模型不完善,超大规模流量的冲击的情况下,许多企业纷纷抛弃了传统的单体架构,拥抱微服务。这种模式具备独立开发、独立部署、可扩展性、可重用性的优点的同时,也带来这样一个问题:开发、运维的复杂性提高。有人感觉微服务越做越不方便管理。
|
Java Docker 微服务
阿里P8携手腾讯T4谈微服务架构实战:深入浅出Cloud+boot+Docker
微服务”架构在这几年被广泛传播,变得非常火热,以至于关于微服务架构相关的开源框架和工具都变得越来越活跃,比如: Netflix OSS. Dubbo. Apache Thrift等。Spring Cloud也因为Spring社区在企业应用领域的广泛知名度和强大影响力,受到了广大架构师与开发者的高度关注。
|
5月前
|
Java Nacos Docker
Spring Cloud Alibaba【什么是Nacos、Nacos Server下载安装 、Docker安装Nacos Server服务、微服务聚合父工程构建】(一)
Spring Cloud Alibaba【什么是Nacos、Nacos Server下载安装 、Docker安装Nacos Server服务、微服务聚合父工程构建】(一)
170 0
|
5月前
|
Java Docker 微服务
阿里P8携手腾讯T4谈微服务架构实战:深入浅出Cloud+boot+Docker
微服务”架构在这几年被广泛传播,变得非常火热,以至于关于微服务架构相关的开源框架和工具都变得越来越活跃,比如: Netflix OSS. Dubbo. Apache Thrift等。Spring Cloud也因为Spring社区在企业应用领域的广泛知名度和强大影响力,受到了广大架构师与开发者的高度关注。
|
5月前
|
Dubbo 应用服务中间件 Docker
阿里P8架构师谈微服务架构:Dubbo+Docker+SpringBoot+Cloud
什么是微服务架构呢?简单说就是将一个完整的应用(单体应用) 按照一定的拆分规则(后文讲述)拆分成多个不同的服务,每个服务都能独立地进行开发、部署、扩展。服务于服务之间通过注入RESTful api或其他方式调用。
|
5月前
|
Java 测试技术 微服务
这可能是2024年把微服务讲的最全了:SpringBoot+Cloud+Docker
最近几年,微服务可谓是大行其道。在业务模型不完善,超大规模流量的冲击的情况下,许多企业纷纷抛弃了传统的单体架构,拥抱微服务。这种模式具备独立开发、独立部署、可扩展性、可重用性的优点的同时,也带来这样一个问题:开发、运维的复杂性提高。有人感觉微服务越做越不方便管理。
|
弹性计算 Linux Apache
部署并使用Docker(Alibaba Cloud Linux 3)
本场景带您体验如何在Alibaba Cloud Linux 3.2104 LTS 64位操作系统的云服务器上部署并使用Docker。
3858 1
|
弹性计算 Linux Apache
部署并使用Docker(Alibaba Cloud Linux 2)
本场景带您体验如何在Alibaba Cloud Linux 2.1903 LTS 64位操作系统的云服务器上部署并使用Docker。
682 0
下一篇
无影云桌面