TechRepublic on Flipboard

2022-12-29 12:37:40 By : Ms. Nancy Yu

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

Your email has been sent

Find out how ServerCat makes it easy to deploy a container to one or more Docker hosts with batch execution.

ServerCat is one of my favorite tools for remotely accessing and monitoring Linux servers. With a beautifully designed UI and user-friendly structure, anyone can use this tool to access remote Linux servers.

But ServerCat has a few other tricks up its crafty sleeve. One such trick is the ability to batch-execute Docker deployments to any supporting server you have connected. With a single command, you can deploy containers to all of your Docker servers and then monitor them to make sure they’re running as expected. I’ll show you how simple it is to do just that by batch-deploying an NGINX container to multiple servers hosting Docker containers.

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

You’ll need ServerCat installed on a macOS device, and at least one Linux host connected that runs Docker.

Before we get into this, know that deploying a container with ServerCat isn’t totally a point-and-click affair, because you will need to know how to deploy that container via the command line. I will demonstrate an NGINX container deployment, which is relatively simple.

The first thing to do is open ServerCat on your macOS device. From the main window, you should see the Execute entry in the left navigation (Figure A).

In the Execute screen (Figure B), you’ll see a list of all the available hosts at the top, the execute command field, and the Execute button.

This isn’t only used for deploying containers; you could also, say, run sudo apt-get upgrade -y on any Ubuntu-based server. But for this demonstration, we’ll deploy a container.

At the top, select all of the Docker servers to which you want to deploy the container. Next, in the Execute Command field, type:

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

With everything set (Figure C), click Execute to deploy the container to the selected hosts.

As you can see in Figure D, one deployment succeeded, while the other did not.

If I go to Hosts and then double click the Docker Swarm entry, I can run docker ps -a to discover port 8080 is already taken, which caused the error (Figure E).

Then, I can attempt another deployment using a different external port with the command:

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

We have to rename docker-nginx to docker-nginx2 because the first name is already taken. That command will succeed, and our NGINX container will be deployed to our Docker Swarm host.

Although ServerCat container deployment isn’t a full-on point-and-click affair, it does make it easy to spin up containers on multiple remote Docker nodes and then monitor those containers. If you know the basics of Docker CLI deployment, ServerCat will help make the deployment and monitoring of those containers a bit easier. Give this all-in-one tool a try, and see if it doesn’t become your go-to means of batch-executing containers to your Docker servers.

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

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.

This is your go-to resource for the latest news and tips on the following topics and more, XaaS, AWS, Microsoft Azure, DevOps, virtualization, the hybrid cloud, and cloud security.

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

Your email has been sent

Your message has been sent

TechRepublic Premium content helps you solve your toughest IT issues and jump-start your career or next project.

Looking for the best payroll software for your small business? Check out our top picks for 2022 and read our in-depth analysis.

Next year, cybercriminals will be as busy as ever. Are IT departments ready?

The company, which for several years has been on a buying spree for best-of-breed products, is integrating platforms to generate synergies for speed, insights and collaboration.

Organize a number of different applicants using an ATS to cut down on the amount of unnecessary time spent finding the right candidate.

Whether you are a Microsoft Excel beginner or an advanced user, you'll benefit from these step-by-step tutorials.

Some operations and tasks don’t require painstaking attention to detail. Unfortunately, processing payroll isn’t one of them. With sensitive salary and wage information, bank and direct deposit accounts, social security numbers, and other personal information in play, the stakes are high. When preparing a payroll run or supporting payroll operations, it’s important to follow a ...

This document is designed to serve as a template that technology consultants and consulting firms can use to create a standardized ethical, professional and behavioral code of conduct for its employees, contractors and subcontractors. From the code of conduct policy: SUMMARY The IT Consultant Code of Conduct Policy describes the practices and behavior the organization’s ...

Onboarding new employees and providing them with the equipment and access they need can be a complex process involving various departments. However, a standard set of guidelines which can be reused and revised as needed can streamline these endeavors. A new employee checklist and default access policy assigns responsibilities for tasks to ensure new hires ...

Are you ready to complete a major data migration but not sure where to start? Or perhaps you’ve already completed your migration, but now you’re having trouble assessing performance on your new systems. Regardless of where you find yourself in the data migration journey, these checklists are designed to help you adhere to all of ...