How to deploy a container to a distant Docker machine with ServerCat

0
356

[ad_1]

Find out how ServerCat makes it simple to deploy a container to a number of Docker hosts with batch execution.

Shipping containers in the shape of a docker whale.
Image: Sergey Novikov/Adobe Stock

ServerCat is one among my favourite instruments for remotely accessing and monitoring Linux servers. With a fantastically designed UI and user-friendly construction, anybody can use this device to entry distant Linux servers.

But ServerCat has a couple of different tips up its artful sleeve. One such trick is the power to batch-execute Docker deployments to any supporting server you have got linked. With a single command, you possibly can deploy containers to all your Docker servers after which monitor them to ensure they’re working as anticipated. I’ll present you the way easy it’s to do exactly that by batch-deploying an NGINX container to a number of servers internet hosting Docker containers.

SEE: Hiring package: Back-end Developer (TechRepublic Premium)

What you’ll have to deploy a container with ServerCat

You’ll want ServerCat put in on a macOS machine, and at the very least one Linux host linked that runs Docker.

How to deploy a container with ServerCat

Before we get into this, know that deploying a container with ServerCat isn’t completely a point-and-click affair, as a result of you’ll need to know tips on how to deploy that container by way of the command line. I’ll exhibit an NGINX container deployment, which is comparatively easy.

The very first thing to do is open ServerCat in your macOS machine. From the primary window, you must see the Execute entry within the left navigation (Figure A).

Figure A

ServerCat offers a very clean and simple to use UI.
ServerCat affords a really clear and easy to make use of UI.

In the Execute display (Figure B), you’ll see a listing of all of the out there hosts on the prime, the execute command subject, and the Execute button.

Figure B

The ServerCat Execute window allows you to batch-execute to any server.
The ServerCat Execute window permits you to batch-execute to any server.

This isn’t solely used for deploying containers; you possibly can additionally, say, run sudo apt-get improve -y on any Ubuntu-based server. But for this demonstration, we’ll deploy a container.

At the highest, choose the entire Docker servers to which you wish to deploy the container. Next, within the Execute Command subject, kind:

docker run --name docker-nginx -p 8080:80 -d nginx

With every little thing set (Figure C), click on Execute to deploy the container to the chosen hosts.

Figure C

Deploying NGINX to two Docker servers at once.
Deploying NGINX to 2 Docker servers directly.

As you possibly can see in Figure D, one deployment succeeded, whereas the opposite didn’t.

Figure D

A failed deployment and a successful deployment.
A failed deployment and a profitable deployment.

If I’m going to Hosts after which double click on the Docker Swarm entry, I can run docker ps -a to find port 8080 is already taken, which brought about the error (Figure E).

Figure E

Our problem has been spotted.
Our downside has been noticed.

Then, I can try one other deployment utilizing a distinct exterior port with the command:

docker run --name docker-nginx2 -p 8081:80 -d nginx

We need to rename docker-nginx to docker-nginx2 as a result of the primary title is already taken. That command will succeed, and our NGINX container will likely be deployed to our Docker Swarm host.

Simple Docker deployment

Although ServerCat container deployment isn’t a full-on point-and-click affair, it does make it simple to spin up containers on a number of distant Docker nodes after which monitor these containers. If you recognize the fundamentals of Docker CLI deployment, ServerCat will assist make the deployment and monitoring of these containers a bit simpler. Give this all-in-one device a strive, and see if it doesn’t turn into your go-to technique of batch-executing containers to your Docker servers.

Continue your IT training with this The Linux & Docker Coding Bundle from TechRepublic Premium.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the most recent tech recommendation for enterprise professionals from Jack Wallen.

LEAVE A REPLY

Please enter your comment!
Please enter your name here