Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Docker Cloud implements the deployment of application operations

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail about the deployment of applications in Docker Cloud. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.

Connect Docker Cloud

You can run Docker Cloud in either standard mode or cluster mode. If you are running Docker Cloud in standard mode, follow these instructions to connect your service provider to Docker Cloud:

Amazon Web Services installation Guide

DigitalOcean installation Guide

Microsoft Azure installation Guide

Packet setup Guid

SoftLayer setup Guid

Use Docker Cloud to proxy your host

If you are running in cluster mode, please continue to read the following.

Create a cluster

If you are using Amazon Web Services (AWS), you can automatically create a cluster on AWS.

If you are using Microsoft Azure, you can automatically create a cluster on Azure.

Otherwise, create your node in Docker Cloud UI and run the docker swarm init and docker swarm join commands through Docker Cloud. Finally, register the created cluster by clicking "enable Swarm Mode" at the top of the screen.

Enable Swarm Mode

Deploy applications on cloud providers

First connect to your cluster through Docker Cloud, from the web interface of Docker Cloud in cluster mode, select "Swarms" at the top of the page, click the cluster you want to connect to, and then copy and paste the given command into the command line terminal.

Or, on Docker for Mac or Docker for Windows, you can connect to the cluster directly through the desktop menu.

Either way, a terminal will open with the context of your local machine, but its Docker commands will be routed to the cluster running on your cloud service provider. You can directly access the local file system and remote clusters, enabling pure Docker commands.

Run docker stack deploy-c docker-compose.yml getstartedlab to deploy the application on a cloud-managed cluster.

$docker stack deploy-c docker-compose.yml getstartedlab

Now your application is running on your cloud provider.

Run some commands to verify the deployment

You can use the swarm command to browse and manage the cluster, such as using docker node ls to list nodes:

$docker node ls

Use docker service ls to list services:

$docker service ls

Use docker service ps to view the tasks of the service:

$docker service ps vy7n2piyqrtr

Open service ports on the machines of cloud providers

At this point, your application will be deployed as a cluster on the cloud provider server, as proved by the docker command you just ran, but you still need to open the port on the cloud server to:

Allows communication between redis services and web services on the worker node.

Allow inbound traffic to the web service on the worker node to access Hello World and Visualizer from the Web browser.

Allow inbound SSH traffic on the server running Manager (may have been set up on the cloud provider)

These are the ports that you need to expose for each service:

ServiceTypeProtocolPortwebHTTPTCP80visualizerHTTPTCP8080redisTCPTCP6379

Iteration and cleanup

Extend the application by changing the docker-compose.yml file and redeploy immediately using the docker stack deploy command. Change the behavior of the application by editing the code, and then rebuild to push the new image. You can also use docker stack rm to clean up the stack, for example:

Docker stack rm getstartedlab on the deployment of Docker Cloud applications to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report