{"id":82136,"date":"2022-12-27T17:01:28","date_gmt":"2022-12-27T17:01:28","guid":{"rendered":"https:\/\/www.techrepublic.com\/?p=4016540"},"modified":"2022-12-27T17:01:28","modified_gmt":"2022-12-27T17:01:28","slug":"how-to-deploy-a-container-to-a-remote-docker-machine-with-servercat","status":"publish","type":"post","link":"https:\/\/cloudnewshub.com\/?p=82136","title":{"rendered":"How to deploy a container to a remote Docker machine with ServerCat"},"content":{"rendered":"<div id>\n<p> Find out how ServerCat makes it easy to deploy a container to one or more Docker hosts with batch execution. <\/p>\n<\/div>\n<div id>\n<figure id=\"attachment_3975992\" aria-describedby=\"caption-attachment-3975992\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-article wp-image-3975992\" src=\"http:\/\/cloudnewshub.com\/wp-content\/uploads\/2022\/12\/how-to-deploy-a-container-to-a-remote-docker-machine-with-servercat.jpg\" alt=\"Shipping containers in the shape of a docker whale.\" width=\"770\" height=\"470\"><figcaption id=\"caption-attachment-3975992\" class=\"wp-caption-text\">Image: Sergey Novikov\/Adobe Stock<\/figcaption><\/figure>\n<p>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.<\/p>\n<p>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\u2019re running as expected. I\u2019ll show you how simple it is to do just that by batch-deploying an NGINX container to multiple servers hosting Docker containers.<\/p>\n<p><strong>SEE: <\/strong><a href=\"https:\/\/www.techrepublic.com\/resource-library\/whitepapers\/hiring-kit-back-end-developer\/\"><strong>Hiring kit: Back-end Developer<\/strong><\/a><strong> (TechRepublic Premium)<\/strong><\/p>\n<h2>What you\u2019ll need to deploy a container with ServerCat<\/h2>\n<p>You\u2019ll need ServerCat installed on a macOS device, and at least one Linux host connected that runs Docker.<\/p>\n<h2>How to deploy a container with ServerCat<\/h2>\n<aside class=\"pinbox right\">\n<h3 class=\"heading\">Cloud: Must-read coverage<\/h3>\n<\/aside>\n<p>Before we get into this, know that deploying a container with ServerCat isn\u2019t 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.<\/p>\n<p>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 (<strong>Figure A<\/strong>).<\/p>\n<p><strong>Figure A<\/strong><\/p>\n<figure id=\"attachment_4016538\" aria-describedby=\"caption-attachment-4016538\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-article wp-image-4016538\" src=\"http:\/\/cloudnewshub.com\/wp-content\/uploads\/2022\/12\/how-to-deploy-a-container-to-a-remote-docker-machine-with-servercat-1.jpg\" alt=\"ServerCat offers a very clean and simple to use UI.\" width=\"770\" height=\"580\"><figcaption id=\"caption-attachment-4016538\" class=\"wp-caption-text\">ServerCat offers a very clean and simple to use UI.<\/figcaption><\/figure>\n<p>In the Execute screen (<strong>Figure B<\/strong>), you\u2019ll see a list of all the available hosts at the top, the execute command field, and the Execute button.<\/p>\n<p><strong>Figure B<\/strong><\/p>\n<figure id=\"attachment_4016536\" aria-describedby=\"caption-attachment-4016536\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-article wp-image-4016536\" src=\"http:\/\/cloudnewshub.com\/wp-content\/uploads\/2022\/12\/how-to-deploy-a-container-to-a-remote-docker-machine-with-servercat-2.jpg\" alt=\"The ServerCat Execute window allows you to batch-execute to any server.\" width=\"770\" height=\"580\"><figcaption id=\"caption-attachment-4016536\" class=\"wp-caption-text\">The ServerCat Execute window allows you to batch-execute to any server.<\/figcaption><\/figure>\n<p>This isn\u2019t only used for deploying containers; you could also, say, run <code>sudo apt-get upgrade -y <\/code>on any Ubuntu-based server. But for this demonstration, we\u2019ll deploy a container.<\/p>\n<p>At the top, select all of the Docker servers to which you want to deploy the container. Next, in the Execute Command field, type:<\/p>\n<p><code>docker run --name docker-nginx -p 8080:80 -d nginx<\/code><\/p>\n<p>With everything set (<strong>Figure C<\/strong>), click Execute to deploy the container to the selected hosts.<\/p>\n<p><strong>Figure C<\/strong><\/p>\n<figure id=\"attachment_4016535\" aria-describedby=\"caption-attachment-4016535\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-article wp-image-4016535\" src=\"http:\/\/cloudnewshub.com\/wp-content\/uploads\/2022\/12\/how-to-deploy-a-container-to-a-remote-docker-machine-with-servercat-3.jpg\" alt=\"Deploying NGINX to two Docker servers at once.\" width=\"770\" height=\"580\"><figcaption id=\"caption-attachment-4016535\" class=\"wp-caption-text\">Deploying NGINX to two Docker servers at once.<\/figcaption><\/figure>\n<p>As you can see in <strong>Figure D<\/strong>, one deployment succeeded, while the other did not.<\/p>\n<p><strong>Figure D<\/strong><\/p>\n<figure id=\"attachment_4016537\" aria-describedby=\"caption-attachment-4016537\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-article wp-image-4016537\" src=\"http:\/\/cloudnewshub.com\/wp-content\/uploads\/2022\/12\/how-to-deploy-a-container-to-a-remote-docker-machine-with-servercat-4.jpg\" alt=\"A failed deployment and a successful deployment.\" width=\"770\" height=\"580\"><figcaption id=\"caption-attachment-4016537\" class=\"wp-caption-text\">A failed deployment and a successful deployment.<\/figcaption><\/figure>\n<p>If I go to Hosts and then double click the Docker Swarm entry, I can run <code>docker ps -a <\/code>to discover port 8080 is already taken, which caused the error (<strong>Figure E<\/strong>).<\/p>\n<p><strong>Figure E<\/strong><\/p>\n<figure id=\"attachment_4016534\" aria-describedby=\"caption-attachment-4016534\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-article wp-image-4016534\" src=\"http:\/\/cloudnewshub.com\/wp-content\/uploads\/2022\/12\/how-to-deploy-a-container-to-a-remote-docker-machine-with-servercat-5.jpg\" alt=\"Our problem has been spotted.\" width=\"770\" height=\"580\"><figcaption id=\"caption-attachment-4016534\" class=\"wp-caption-text\">Our problem has been spotted.<\/figcaption><\/figure>\n<p>Then, I can attempt another deployment using a different external port with the command:<\/p>\n<p><code>docker run --name docker-nginx2 -p 8081:80 -d nginx<\/code><\/p>\n<p>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.<\/p>\n<h2>Simple Docker deployment<\/h2>\n<p>Although ServerCat container deployment isn\u2019t 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\u2019t become your go-to means of batch-executing containers to your Docker servers.<\/p>\n<p>Continue your IT education with this <a href=\"https:\/\/academy.techrepublic.com\/sales\/the-linux-and-docker-coding-bundle\" target=\"_blank\" rel=\"noopener noreferrer\">The Linux &amp; Docker Coding Bundle<\/a> from TechRepublic Premium.<\/p>\n<p><strong><em>Subscribe to TechRepublic\u2019s <\/em><\/strong><em><a href=\"https:\/\/www.youtube.com\/channel\/UCKyMiy1zmJ7aZ8aP6DLZLIA\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>How To Make Tech Work on YouTube<\/strong><\/a><strong> for all the latest tech advice for business pros from Jack Wallen.<\/strong><\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Find out how ServerCat makes it easy to deploy a container to one or more Docker hosts with batch execution. Image: Sergey Novikov\/Adobe Stock 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":82137,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[253,40,783,315,596,177],"tags":[],"class_list":["post-82136","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apple","category-cloud","category-cloudsync","category-containers","category-linux","category-open-source"],"_links":{"self":[{"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/posts\/82136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=82136"}],"version-history":[{"count":0,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/posts\/82136\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=\/wp\/v2\/media\/82137"}],"wp:attachment":[{"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=82136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=82136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudnewshub.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=82136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}