{"id":14475,"date":"2016-08-23T12:15:05","date_gmt":"2016-08-23T09:15:05","guid":{"rendered":"https:\/\/www.webcodegeeks.com\/?p=14475"},"modified":"2016-08-21T22:56:56","modified_gmt":"2016-08-21T19:56:56","slug":"running-services-within-docker-swarm","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/","title":{"rendered":"Running Services within a Docker Swarm"},"content":{"rendered":"<p>When Docker released its latest version, Docker Engine v1.12, it included quite a few changes to the capabilities provided by Docker Swarm. In today\u2019s article, we\u2019ll be exploring how to deploy a service using Docker\u2019s Swarm Mode.<\/p>\n<h2>Activating Swarm Mode on Ubuntu 16.04<\/h2>\n<p>Before we can deploy a service on a Docker Engine Swarm, we will first need to set up a Swarm Cluster. Since we\u2019re showing capabilities added with 1.12, we will also be installing the latest version of Docker Engine.<\/p>\n<p>The following instructions will guide you through installing Docker Engine on Ubuntu 16.04. For other versions and platforms, you can follow Docker\u2019s <a href=\"https:\/\/docs.docker.com\/engine\/installation\/#installation\">official installation guide<\/a>.<\/p>\n<h3>Setting up the Docker Apt repository<\/h3>\n<p>For this installation, we\u2019ll be using the standard installation method for Ubuntu, which relies on the Apt package manager. Since we will be installing the latest version of Docker Engine, we need to configure Apt to pull the <code>docker-engine<\/code> package from Docker\u2019s official Apt repository rather than the systems preconfigured repositories.<\/p>\n<h2>Add Docker\u2019s Public Key<\/h2>\n<p>The first step in configuring Apt to use a new repository is to add that repository\u2019s public key into Apt\u2019s cache with the <code>apt-key<\/code> command.<\/p>\n<pre class=\"brush:php\"># apt-key adv --keyserver hkp:\/\/p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D<\/pre>\n<p>The above <code>apt-key<\/code> command requests the specified key (<code>58118E89F3A912897C070ADBF76221572C52609D<\/code>), from the <code>p80.pool.sks-keyservers.net<\/code> key server. This public key will be used to validate all packages downloaded from the new repository.<\/p>\n<h2>Specifying Docker\u2019s repository location<\/h2>\n<p>With Docker\u2019s public key now imported, we can configure Apt to use the Docker Project\u2019s repository server. We will do this by adding an entry within the <code>\/etc\/apt\/sources.list.d\/<\/code> directory.<\/p>\n<pre class=\"brush:php\"># echo \"deb https:\/\/apt.dockerproject.org\/repo ubuntu-xenial main\" &gt;&gt; \/etc\/apt\/sources.list.d\/docker.list<\/pre>\n<p>When we refresh Apt\u2019s package cache, Apt will look through all files within the <code>sources.list.d\/<\/code> directory to find new package repositories. The command I just showed you creates (if it doesn\u2019t already exist) a new file called <code>docker.list<\/code> with an entry that adds the <code>apt.dockerproject.org<\/code> repository.<\/p>\n<h2>Updating Apt\u2019s package cache<\/h2>\n<p>To refresh Apt\u2019s package cache, we can run the <code>apt-get<\/code> command with the <code>update<\/code> option.<\/p>\n<pre class=\"brush:php\"># apt-get update<\/pre>\n<p>This will cause Apt to repopulate its list of repositories by rereading all of its configuration files, including the one we just added. It will also query those repositories to cache a list of available packages.<\/p>\n<h3>Installing the <code>linux-image-extra<\/code> prerequisite<\/h3>\n<p>Before installing Docker Engine, we need to install a prerequisite package. The <code>linux-image-extra<\/code> package is a kernel specific package that\u2019s needed for Ubuntu systems to support the <code>aufs<\/code> storage driver. This driver is used by Docker for mounting volumes within containers.<\/p>\n<p>To install this package, we will use the <code>apt-get<\/code> command again, but this time with the <code>install<\/code> option.<\/p>\n<pre class=\"brush:php\"># apt-get install linux-image-extra-$(uname -r)<\/pre>\n<p>In that <code>apt-get<\/code> command, the <code>$(uname -r)<\/code> portion or the command will return the kernel version for the current running kernel. Any kernel updates to this system should include the installation of the appropriate <code>linux-image-extra<\/code> package version that coincides with the new kernel version. If this package is not updated as well, some issues may arise with Docker\u2019s ability to mount volumes.<\/p>\n<h3>Install Docker Engine<\/h3>\n<p>With Apt configured and the <code>linux-image-extra<\/code> prerequisite package installed, we can now move to installing Docker Engine. To do so, we will once again use the <code>apt-get<\/code> command with the <code>install<\/code> option to install the <code>docker-engine<\/code> package.<\/p>\n<pre class=\"brush:php\"># apt-get install docker-engine<\/pre>\n<p>At this point, we should have <code>Docker Engine v1.12.0<\/code> or newer installed. To verify that we have the correct version, we can execute the <code>docker<\/code> command with the <code>version<\/code> option.<\/p>\n<pre class=\"brush:php\"># docker version\r\nClient:\r\n Version:      1.12.0\r\n API version:  1.24\r\n Go version:   go1.6.3\r\n Git commit:   8eab29e\r\n Built:        Thu Jul 28 22:11:10 2016\r\n OS\/Arch:      linux\/amd64\r\n\r\nServer:\r\n Version:      1.12.0\r\n API version:  1.24\r\n Go version:   go1.6.3\r\n Git commit:   8eab29e\r\n Built:        Thu Jul 28 22:11:10 2016\r\n OS\/Arch:      linux\/amd64<\/pre>\n<p>With this, we can see that both the Server and Client versions are <code>1.12.0<\/code>. From here, we can move on to creating our Swarm.<\/p>\n<p>!New Call-to-action<\/p>\n<h3>Creating a Docker Swarm<\/h3>\n<p>From this point on within this article, we will be executing tasks from several machines. To help make things a bit more clear, I have included the hostname in the command examples.<\/p>\n<p>We will start our Swarm Cluster with two nodes. At this point, both of these nodes should have Docker Engine installed based on the instructions above.<\/p>\n<p>When creating the Swarm Cluster, we will need to designate a node manager. For this example, we\u2019ll be using a host by the name of <code>swarm-01<\/code> as a node manager. To make <code>swarm-01<\/code> a node manager, we need to create our Swarm Cluster by executing a command on <code>swarm-01<\/code> first. The command we will be executing is the <code>docker<\/code> command with the <code>swarm init<\/code> options.<\/p>\n<pre class=\"brush:php\">root@swarm-01:~# docker swarm init --advertise-addr 10.0.0.1\r\nSwarm initialized: current node (awwiap1z5vtxponawdqndl0e7) is now a manager.\r\n\r\nTo add a worker to this swarm, run the following command:\r\n    docker swarm join \\\r\n    --token SWMTKN-1-51pzs5ax8dmp3h0ic72m9wq9vtagevp1ncrgik115qwo058ie6-3fokbd3onl2i8r7dowtlwh7kb \\\r\n    10.0.0.1:2377\r\n\r\nTo add a manager to this swarm, run the following command:\r\n    docker swarm join \\\r\n    --token SWMTKN-1-51pzs5ax8dmp3h0ic72m9wq9vtagevp1ncrgik115qwo058ie6-bwex7fd4u5aov4naa5trcxs34 \\\r\n    10.0.0.1:2377<\/pre>\n<p>With the above command, in addition to the <code>swarm init<\/code>, we also specified the <code>--advertise-addr<\/code> flag with a value of <code>10.0.0.1<\/code>. This is the IP that the Swarm node manager will use to advertise the Swarm Cluster Service. While this address can be a private IP, it\u2019s important to note that in order for nodes to join this swarm, those nodes will need to be able to connect to the node manager over this IP on port <code>2377<\/code>.<\/p>\n<p>After running the <code>docker swarm init<\/code> command, we can see that the <code>swarm-01<\/code> was given a node name (<code>awwiap1z5vtxponawdqndl0e7<\/code>) and made the manager of this swarm. The output also supplies two commands: one command is to add a node worker to the swarm and the other is to add another node manager to the swarm.<\/p>\n<p>Docker Swarm Mode can support multiple node managers. It will, however, elect one of them to be the primary node manager which will be responsible for orchestration within the Swarm.<\/p>\n<h2>Adding a node worker to the Swarm Cluster<\/h2>\n<p>With the Swarm Cluster created, we can now add a new node worker using the <code>docker<\/code> command provided by the output of the Swarm creation.<\/p>\n<pre class=\"brush:php\">root@swarm-02:~# docker swarm join \\\r\n&gt; --token SWMTKN-1-51pzs5ax8dmp3h0ic72m9wq9vtagevp1ncrgik115qwo058ie6-3fokbd3onl2i8r7dowtlwh7kb \\\r\n&gt; 10.0.0.1:2377\r\nThis node joined a swarm as a worker.<\/pre>\n<p>In this example, we added <code>swarm-02<\/code> to the swarm as a node worker. A node worker is a member of the Swarm Cluster whose role is to run tasks; in this case, tasks are containers. The node manager on the other hand has a role of managing the orchestration of tasks (containers) and maintaining the Swarm Cluster itself.<\/p>\n<p>In addition to its node manager duties, a node manager is also a node worker, which means it will also run tasks for our Swarm Cluster.<\/p>\n<h2>Viewing the current Swarm nodes<\/h2>\n<p>With the previous commands executed, we now have a basic two-node Swarm Cluster. We can verify the status of this cluster by executing the <code>docker<\/code> command with the <code>node ls<\/code> options.<\/p>\n<pre class=\"brush:php\">root@swarm-01:~# docker node ls\r\nID                           HOSTNAME              STATUS  AVAILABILITY  MANAGER STATUS\r\n13evr7hmiujjanbnu3n92dphk    swarm-02.example.com  Ready   Active        \r\nawwiap1z5vtxponawdqndl0e7 *  swarm-01.example.com  Ready   Active        Leader<\/pre>\n<p>From the output of this command, we can see that both <code>swarm-01<\/code> and <code>swarm-02<\/code> are in a <code>Ready<\/code> and <code>Active<\/code> state. With this, we can now move on to deploying services to this Swarm Cluster.<\/p>\n<h2>Creating a Service<\/h2>\n<p>With Docker Swarm Mode, a service is a long-running Docker container that can be deployed to any node worker. It\u2019s something that either remote systems or other containers within the swarm can connect to and consume.<\/p>\n<p>For this example, we\u2019re going to deploy a Redis service.<\/p>\n<h3>Deploying a Replicated Service<\/h3>\n<p>A replicated service is a Docker Swarm service that has a specified number of replicas running. These replicas consist of multiple instances of the specified Docker container. In our case, each replica will be a unique Redis instance.<\/p>\n<p>To create our new service, we\u2019ll use the <code>docker<\/code> command while specifying the <code>service create<\/code> options. The followingw command will create a service named <code>redis<\/code> that has <code>2<\/code> replicas and publishes port <code>6379<\/code> across the cluster.<\/p>\n<pre class=\"brush:php\">root@swarm-01:~# docker service create --name redis --replicas 2 --publish 6379:6379 redis\r\ner238pvukeqdev10nfmh9q1kr<\/pre>\n<p>In addition to specifying the <code>service create<\/code> options, we also used the <code>--name<\/code> flag to name the service <code>redis<\/code> and the <code>--replicas<\/code> flag to specify that this service should run on <code>2<\/code> different nodes. We can validate that it is in fact running on both nodes by executing the <code>docker<\/code> command with the <code>service ls<\/code> options.<\/p>\n<pre class=\"brush:php\">root@swarm-01:~# docker service ls\r\nID            NAME   REPLICAS  IMAGE  COMMAND\r\ner238pvukeqd  redis  2\/2       redis<\/pre>\n<p>In the output, we can see there are <code>2<\/code> of <code>2<\/code> replicas currently running. If we want to see more details on these tasks, we can run the <code>docker<\/code> command with the <code>service ps<\/code> option.<\/p>\n<pre class=\"brush:php\">root@swarm-01:~# docker service ps redis\r\nID                         NAME     IMAGE  NODE                  DESIRED STATE  CURRENT STATE           ERROR\r\n5lr10nbpy91csmc91cew5cul1  redis.1  redis  swarm-02.example.com  Running        Running 40 minutes ago  \r\n1t77jsgo1qajxxdekbenl4pgk  redis.2  redis  swarm-01.example.com  Running        Running 40 minutes ago<\/pre>\n<p>The <code>service ps<\/code> option will show the tasks (containers) for the specified service. In this example, we can see the <code>redis<\/code> service has a task (container) running on both of our swarm nodes.<\/p>\n<h2>Connecting to the Redis service<\/h2>\n<p>Since we have validated that the service is running, we can try to connect to this service from a remote system with the <code>redis-cli<\/code> client.<\/p>\n<pre class=\"brush:php\">vagrant@vagrant:~$ redis-cli -h swarm-01.example.com -p 6379\r\nswarm-01.example.com:6379&gt;<\/pre>\n<p>From the connection above, we were successful in connecting to the <code>redis<\/code> service. This means our service is up and available.<\/p>\n<h3>How Docker Swarm publishes services<\/h3>\n<p>When we created the <code>redis<\/code> service, we used the <code>--publish<\/code> flag with the <code>docker service create<\/code> command. This flag was used to tell Docker to publish port <code>6379<\/code> as an available port for the <code>redis<\/code> service.<\/p>\n<p>When Docker publishes a port for a service, it does so by listening on that port across all nodes within the Swarm Cluster. When traffic arrives on that port, that traffic is then routed to a container running for that service. While this concept is pretty standard when all nodes are running a service\u2019s container, this concept gets interesting when we have more nodes than we do replicas.<\/p>\n<p>To see how this works, let\u2019s add a third node worker to the Swarm Cluster.<\/p>\n<h2>Adding a third node worker into the mix<\/h2>\n<p>To add another node worker, we can simply repeat the installation and setup steps in the first part of this article. Since we already covered those steps, we\u2019ll skip ahead to the point where we have a three-node Swarm Cluster. We can once again check the status of this cluster by running the <code>docker<\/code> command.<\/p>\n<pre class=\"brush:php\">root@swarm-01:~# docker node ls\r\nID                           HOSTNAME              STATUS  AVAILABILITY  MANAGER STATUS\r\n13evr7hmiujjanbnu3n92dphk    swarm-02.example.com  Ready   Active        \r\nawwiap1z5vtxponawdqndl0e7 *  swarm-01.example.com  Ready   Active        Leader\r\ne4ymm89082ooms0gs3iyn8vtl    swarm-03.example.com  Ready   Active<\/pre>\n<p>We can see that the cluster consists of three hosts:<\/p>\n<ul>\n<li><code>swarm-01<\/code><\/li>\n<li><code>swarm-02<\/code><\/li>\n<li><code>swarm-03<\/code><\/li>\n<\/ul>\n<p>When we created our service with two replicas, it created a task (container) on <code>swarm-01<\/code> and <code>swarm-02<\/code>. Let\u2019s see if this is still the case even though we added another node worker.<\/p>\n<pre class=\"brush:php\">root@swarm-01:~# docker service ps redis\r\nID                         NAME     IMAGE  NODE                  DESIRED STATE  CURRENT STATE           ERROR\r\n5lr10nbpy91csmc91cew5cul1  redis.1  redis  swarm-02.example.com  Running        Running 55 minutes ago  \r\n1t77jsgo1qajxxdekbenl4pgk  redis.2  redis  swarm-01.example.com  Running        Running 55 minutes ago<\/pre>\n<p>With replicated services, Docker Swarm\u2019s goal is to ensure that there is a task (container) running for every replica specified. When we created the <code>redis<\/code> service, we specified that there should be <code>2<\/code> replicas. This means that even though we have a third node, Docker has no reason to start a new task on that node.<\/p>\n<p>At this point, we have an interesting situation: We have a service that\u2019s running on <code>2<\/code> of the <code>3<\/code> Swarm nodes. In a non-Swarm world, that would mean the <code>redis<\/code> service would be unavailable when connecting to our third Swarm node. With Swarm Mode however, that is not the case.<\/p>\n<h2>Connecting to a service on a non-task-running worker<\/h2>\n<p>Earlier when I described how Docker publishes a service port, I mentioned that it does so by publishing that port across all nodes within the Swarm. What\u2019s interesting about this is what happens when we connect to a node worker that isn\u2019t running any containers (tasks) associated with our service.<\/p>\n<p>Let\u2019s take a look at what happens when we connect to <code>swarm-03<\/code> over the <code>redis<\/code> published port.<\/p>\n<pre class=\"brush:php\">vagrant@vagrant:~$ redis-cli -h swarm-03.example.com -p 6379\r\nswarm-03.example.com:6379&gt;<\/pre>\n<p>What\u2019s interesting about this is that our connection was successful. It was successful despite the fact that <code>swarm-03<\/code> is not running any <code>redis<\/code> containers. This works because internally Docker is rerouting our <code>redis<\/code> service traffic to a node worker running a <code>redis<\/code> container.<\/p>\n<p>Docker calls this <em>ingress load balancing<\/em>. The way it works is that all node workers listen for connections to published service ports. When that service is called by external systems, the receiving node will accept the traffic and internally load balance it using an internal DNS service that Docker maintains.<\/p>\n<p>So even if we scaled out our Swarm cluster to 100 node workers, end users of our <code>redis<\/code> service can simply connect to any node worker. They will then be redirected to one of the two Docker hosts running the service tasks (containers).<\/p>\n<p>All of this rerouting and load balancing is completely transparent to the end user. It all happens within the Swarm Cluster.<\/p>\n<h3>Making our service global<\/h3>\n<p>At this point, we have the <code>redis<\/code> service setup to run with <code>2<\/code> replicas, meaning it\u2019s running containers on <code>2<\/code> of the <code>3<\/code> nodes.<\/p>\n<p>If we wanted our <code>redis<\/code> service to consist of an instance on every node worker, we could do that easily by modifying the service\u2019s number of desired replicas from <code>2<\/code> to <code>3<\/code>. This would mean however that with every node worker we add or subtract, we will need to adjust the number of replicas.<\/p>\n<p>We could alternatively do this automatically by making our service a Global Service. A Global Service in Docker Swarm Mode is used to create a service that has a task running on every node worker automatically. This is useful for common services such as Redis that may be leveraged internally by other services.<\/p>\n<p>To show this in action, let\u2019s go ahead and recreate our <code>redis<\/code> service as a Global Service.<\/p>\n<pre class=\"brush:php\">root@swarm-01:~# docker service create --name redis --mode global --publish 6379:6379 redis\r\n5o8m338zmsped0cmqe0guh2to<\/pre>\n<p>The command to create a Global Service is the same <code>docker service create<\/code> command we used to create a replicated service. The only difference is the <code>--mode<\/code> flag along with the value of <code>global<\/code>.<\/p>\n<p>With the service now created, we can see how Docker distributed our tasks for this service by once again executing the <code>docker<\/code> command with the <code>service ps<\/code> options.<\/p>\n<pre class=\"brush:php\">root@swarm-01:~# docker service ps redis\r\nID                         NAME       IMAGE  NODE                  DESIRED STATE  CURRENT STATE           ERROR\r\n27s6q5yvmyjvty8jvp5k067ul  redis      redis  swarm-03.example.com  Running        Running 26 seconds ago  \r\n2xohhkqvlw7969qj6j0ca70xx   \\_ redis  redis  swarm-02.example.com  Running        Running 38 seconds ago  \r\n22wrdkun5f5t9lku6sbprqi1k   \\_ redis  redis  swarm-01.example.com  Running        Running 38 seconds ago<\/pre>\n<p>We can see that when the service was created as a Global Service, a task was then started on every node worker within our Swarm Cluster.<\/p>\n<h2>Summary<\/h2>\n<p>In this article, we not only installed Docker Engine, we also set up a Swarm Cluster, deployed a replicated service, and then created a Global Service.<\/p>\n<p>In a recent article, I not only <a href=\"https:\/\/www.webcodegeeks.com\/web-development\/getting-started-kubernetes\/\">installed Kubernetes, I also created a Kubernetes service<\/a>. In comparing the Docker Swarm Mode services with the Kubernetes services, I personally find that Swarm Mode services were easier to get set up and created. For someone who simply wishes to use the \u201cservices\u201d features of Kubernetes and doesn\u2019t need some of its other capabilities, Docker Swarm Mode may be an easier alternative.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"https:\/\/blog.codeship.com\/running-services-within-docker-swarm\/\">Running Services within a Docker Swarm<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/join-us\/wcg\/\">WCG partner<\/a> Ben Cane at the <a href=\"http:\/\/blog.codeship.com\/\">Codeship Blog<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>When Docker released its latest version, Docker Engine v1.12, it included quite a few changes to the capabilities provided by Docker Swarm. In today\u2019s article, we\u2019ll be exploring how to deploy a service using Docker\u2019s Swarm Mode. Activating Swarm Mode on Ubuntu 16.04 Before we can deploy a service on a Docker Engine Swarm, we &hellip;<\/p>\n","protected":false},"author":158,"featured_media":10356,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[217],"class_list":["post-14475","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","tag-docker"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Running Services within a Docker Swarm - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"When Docker released its latest version, Docker Engine v1.12, it included quite a few changes to the capabilities provided by Docker Swarm. In today\u2019s\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Running Services within a Docker Swarm - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"When Docker released its latest version, Docker Engine v1.12, it included quite a few changes to the capabilities provided by Docker Swarm. In today\u2019s\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-23T09:15:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Benjamin Cane\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin Cane\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/\"},\"author\":{\"name\":\"Benjamin Cane\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/4f5d918df9c19fab91b5b205357ce0b8\"},\"headline\":\"Running Services within a Docker Swarm\",\"datePublished\":\"2016-08-23T09:15:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/\"},\"wordCount\":2200,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"keywords\":[\"Docker\"],\"articleSection\":[\"DevOps\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/\",\"name\":\"Running Services within a Docker Swarm - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"datePublished\":\"2016-08-23T09:15:05+00:00\",\"description\":\"When Docker released its latest version, Docker Engine v1.12, it included quite a few changes to the capabilities provided by Docker Swarm. In today\u2019s\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DevOps\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/devops\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Running Services within a Docker Swarm\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/4f5d918df9c19fab91b5b205357ce0b8\",\"name\":\"Benjamin Cane\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/09c6af2f1a7430456089189937094b817ef1b7c75ab9968bfd3ec35d938d914b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/09c6af2f1a7430456089189937094b817ef1b7c75ab9968bfd3ec35d938d914b?s=96&d=mm&r=g\",\"caption\":\"Benjamin Cane\"},\"description\":\"Benjamin Cane is a systems architect in the financial services industry. He writes about Linux systems administration on his blog and has recently published his first book, Red Hat Enterprise Linux Troubleshooting Guide.\",\"url\":\"https:\/\/www.webcodegeeks.com\/author\/benjamin-cane\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Running Services within a Docker Swarm - Web Code Geeks - 2026","description":"When Docker released its latest version, Docker Engine v1.12, it included quite a few changes to the capabilities provided by Docker Swarm. In today\u2019s","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/","og_locale":"en_US","og_type":"article","og_title":"Running Services within a Docker Swarm - Web Code Geeks - 2026","og_description":"When Docker released its latest version, Docker Engine v1.12, it included quite a few changes to the capabilities provided by Docker Swarm. In today\u2019s","og_url":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2016-08-23T09:15:05+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","type":"image\/jpeg"}],"author":"Benjamin Cane","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Benjamin Cane","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/"},"author":{"name":"Benjamin Cane","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/4f5d918df9c19fab91b5b205357ce0b8"},"headline":"Running Services within a Docker Swarm","datePublished":"2016-08-23T09:15:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/"},"wordCount":2200,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","keywords":["Docker"],"articleSection":["DevOps"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/","url":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/","name":"Running Services within a Docker Swarm - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","datePublished":"2016-08-23T09:15:05+00:00","description":"When Docker released its latest version, Docker Engine v1.12, it included quite a few changes to the capabilities provided by Docker Swarm. In today\u2019s","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/devops\/running-services-within-docker-swarm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"DevOps","item":"https:\/\/www.webcodegeeks.com\/category\/devops\/"},{"@type":"ListItem","position":3,"name":"Running Services within a Docker Swarm"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/4f5d918df9c19fab91b5b205357ce0b8","name":"Benjamin Cane","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/09c6af2f1a7430456089189937094b817ef1b7c75ab9968bfd3ec35d938d914b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/09c6af2f1a7430456089189937094b817ef1b7c75ab9968bfd3ec35d938d914b?s=96&d=mm&r=g","caption":"Benjamin Cane"},"description":"Benjamin Cane is a systems architect in the financial services industry. He writes about Linux systems administration on his blog and has recently published his first book, Red Hat Enterprise Linux Troubleshooting Guide.","url":"https:\/\/www.webcodegeeks.com\/author\/benjamin-cane\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/14475","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/158"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=14475"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/14475\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/10356"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=14475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=14475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=14475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}