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

How to Deploy a Container to a Remote Docker Machine with Servercat

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

Home » News » How to deploy a container to a remote Docker machine with ServerCat
Table of Contents
Shipping Containers in the Shape of a Docker Whale.
picture sergey novikovadobe inventory

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

However 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’ve related. With a single command, you may deploy containers to all your Docker servers after which monitor them to verify they’re operating as anticipated. I’ll present you ways easy it’s to just do that by batch-deploying an NGINX container to a number of servers internet hosting Docker containers.

SEE: Hiring equipment: Again-end Developer (roosho Premium)

What you’ll have to deploy a container with ServerCat

You’ll want ServerCat put in on a macOS gadget, and a minimum of one Linux host related that runs Docker.

The way to deploy a container with ServerCat

Earlier than we get into this, know that deploying a container with ServerCat isn’t completely a point-and-click affair, as a result of you will have to know tips on how to deploy that container through the command line. I’ll display an NGINX container deployment, which is comparatively easy.

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

Determine A

Servercat Offers a Very Clean and Simple to Use Ui.
servercat provides a really clear and easy to make use of ui

Within the Execute display screen (Determine B), you’ll see a listing of all of the accessible hosts on the prime, the execute command subject, and the Execute button.

Determine B

the Servercat Execute Window Allows You to Batch-execute to Any Server.
the servercat execute window lets you batch execute to any server

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

On the prime, choose all the Docker servers to which you wish to deploy the container. Subsequent, within the Execute Command subject, sort:

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

With every part set (Determine C), click on Execute to deploy the container to the chosen hosts.

Determine C

Deploying Nginx to Two Docker Servers at Once.
deploying nginx to 2 docker servers directly

As you may see in Determine D, one deployment succeeded, whereas the opposite didn’t.

Determine D

a Failed Deployment and a Successful Deployment.
a failed deployment and a profitable deployment

If I am 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 prompted the error (Determine E).

Determine E

Our Problem Has Been Spotted.
our drawback has been noticed

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

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

Now we have to rename docker-nginx to docker-nginx2 as a result of the primary identify is already taken. That command will succeed, and our NGINX container might be deployed to our Docker Swarm host.

Easy Docker deployment

Though 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 software a strive, and see if it doesn’t change into your go-to technique of batch-executing containers to your Docker servers.

Proceed your IT schooling with this The Linux & Docker Coding Bundle from roosho Premium.

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

author avatar
roosho Senior Engineer (Technical Services)
I am Rakib Raihan RooSho, Jack of all IT Trades. You got it right. Good for nothing. I try a lot of things and fail more than that. That's how I learn. Whenever I succeed, I note that in my cookbook. Eventually, that became my blog. 
share this article.

Enjoying my articles?

Sign up to get new content delivered straight to your inbox.

Please enable JavaScript in your browser to complete this form.
Name