{"id":26168,"date":"2015-09-14T12:36:17","date_gmt":"2015-09-14T07:06:17","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=26168"},"modified":"2016-01-19T13:32:30","modified_gmt":"2016-01-19T08:02:30","slug":"docker-containers-and-aws-auto-scaling-hand-in-hand","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/","title":{"rendered":"Docker containers and AWS Auto-scaling &#8211; Hand in Hand"},"content":{"rendered":"<p>In my <a href=\"http:\/\/www.tothenew.com\/blog\/setting-up-sendmail-inside-your-docker-container\/\">previous blog<\/a>, I talked about setting up sendmail inside a Docker container.\u00a0In this blog, we will talk about how to make your <a title=\"Docker DevOps\" href=\"http:\/\/www.tothenew.com\/devops-chef-puppet-docker\" target=\"_blank\">Docker<\/a> containers come up during Auto-scaling of AWS servers, start, and use a service like sendmail inside them. You can make changes to scripts based on your use-case. I just want to make the logic clear.<\/p>\n<h3><strong><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-26635 aligncenter\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/09\/cicd-with-docker-on-aws-1-638.jpg\" alt=\"cicd-with-docker-on-aws-1-638\" width=\"621\" height=\"399\" \/><\/strong><\/h3>\n<h3><\/h3>\n<p><strong><br \/>\nUse-case\u00a0<\/strong><\/p>\n<p>I had a PHP application running inside my Docker container (CentOS 7 based), being served by httpd (Apache2). This was single container running on a host machine. A use-case arose when I thought of what would happen when the traffic to my website increased or the CPU utilization went high etc. . I would have to scale my containers i.e. launch a new server and run a container inside that. Also, what I needed to do is keep the containers isolated &amp; check whether the container has come up in auto-scaling or not. So, that is what the blog is about.\u00a0So, I have made a script which you can add to user data in Launch Configuration.<\/p>\n<h3><strong>Prerequisites\u00a0<\/strong><\/h3>\n<p>What I will assume is that \u00a0you already have a Docker container running (CentOS 7 based), and it is serving some PHP application through httpd.<br \/>\nAlso, what more you need is :-<\/p>\n<ol>\n<li>An Auto-scaling group &amp; Launch Configuration in your AWS account.<\/li>\n<li>Your host machine&#8217;s AMI added to the Launch Configuration.<\/li>\n<li>Latest image of your running container committed to Docker Hub or you may locally commit the container image &amp; create an AMI from that and add to Launch Configuration group.<\/li>\n<li>Host machine may be Amazon Linux or CentOS\/RedHat. ( Even Ubuntu, but commands may slightly differ)<\/li>\n<li>sendmail service installed &amp; running on host machine. (This will be used to send an email when Docker container comes up)<\/li>\n<\/ol>\n<h3>How to implement it<\/h3>\n<p><strong>Explanation<\/strong> : Lets talk about the scripts. As we know every time a new container starts the entry in <strong>\/etc\/hosts<\/strong> changes to default with the new container ID. As sendmail requires a domain name to work, we will be using 2 scripts for sendmail about which we talked about in the previous blog, first being <strong>dockerscriptetchosts.sh<\/strong> and the other being<strong>\u00a0startsendmail.sh<\/strong>.\u00a0Let us go through them one by one before we come to our main script <strong>autodeploy.sh<\/strong><\/p>\n<p>So, the first script for sendmail is\u00a0<strong>dockerscriptetchosts.sh<\/strong><\/p>\n<pre>#!\/bin\/bash\r\n\r\nline=$(head -n 1 \/etc\/hosts) \r\nline2=$(echo $line | awk '{print $2}')\r\n\r\necho \"$line $line2.localdomain\" &gt;&gt; \/etc\/hosts<\/pre>\n<p>The above script has already been added to the image using ADD in Dockerfile. It makes the necessary entry to \/etc\/hosts of the Docker container which are as follows :-<\/p>\n<p><code>container_IP container_id container_id.localdomain<br \/>\n<\/code><\/p>\n<p>Next script is <strong>startsendmail.sh.<\/strong><\/p>\n<pre>#!\/bin\/bash\r\nsudo docker exec -itd $1 bash \/home\/dockerscriptetchosts.sh\r\nsudo docker exec -itd $1 \/etc\/init.d\/sendmail start\r\nsudo docker exec -itd $1 \/usr\/sbin\/httpd -k restart\r\n<\/pre>\n<p>This script is present on the host machine &amp; takes one parameter input (<strong>container_id<\/strong>) to execute which we will pass in the main script. It firstly runs <strong>docker exec<\/strong> command which in turn runs the command <strong>bash \/home\/dockerscriptetchosts.sh<\/strong>\u00a0inside the Docker container and in turn the next commands. The last command restarts httpd.<\/p>\n<p>The main script <strong>autodeploy.sh<\/strong> is below. Just go through it and I will explain the script just after that. You will need to put this bash script in the <strong>user-data<\/strong>.<\/p>\n<p>[js]#!\/bin\/bash<br \/>\nsudo docker pull ranvijayj\/prod:latest #this is if you want to pull from Docker Hub<\/p>\n<p>container_id=$(docker run -idt -p 80:80 &#8211;restart=&quot;always&quot; -v \/mnt\/code:\/opt\/code prod:latest)<\/p>\n<p>#check whether container is running or not<\/p>\n<p>sleep 5<\/p>\n<p>if [ `docker inspect -f {{.State.Running}} $container_id` == &quot;true&quot; ]; then<\/p>\n<p> echo &quot;Container has restarted .. Volume mounted&quot; | sendmail -s &quot; Container has come up in autoscaling&quot; ranvijay.jamwal@tothenew.com<br \/>\n sleep 20<br \/>\n http_status=$(curl -Is localhost:80 | head -n 1 | awk &#8216;{ print $2}&#8217;)<\/p>\n<p> if [ $http_status == 200 ]; then<\/p>\n<p> echo &quot;Container is SERVING the website&quot; | sendmail -s &quot; Container is serving the website&quot; ranvijay.jamwal@tothenew.com<\/p>\n<p> #once the container has started we need to start the sendmail service<br \/>\n #startsendmail can be present in any directory of AMI<br \/>\n bash \/home\/ec2-user\/startsendmail.sh<\/p>\n<p> else<br \/>\n echo &quot;Container has FAILED to serve the website.. http_status= $http_status&quot; | sendmail -s &quot; Container is NOT SERVING at port 80&quot; ranvijay.jamwal@tothenew.com<br \/>\n fi<\/p>\n<p>else<br \/>\n echo &quot;Container has not restarted\/started&quot; | sendmail -s &quot; Container has failed to come up in autoscaling &amp;amp; is NOT serving the website&quot; ranvijay.jamwal@tothenew.com<\/p>\n<p>fi [\/js]<\/p>\n<p>&nbsp;<\/p>\n<p>So, what the script is doing, is the following &amp; we will understand it line by line :-<\/p>\n<ol>\n<li>Using the Docker image we have defined it launches a container in detached mode<\/li>\n<li>It also exposes port 80 to the outside world, mounts directory<strong> \/mnt\/code<\/strong> from host machine to <strong>\/opt\/code<\/strong> using <strong>-v<\/strong> switch, \u00a0sets the variable &#8212;<strong>restart<\/strong> to &#8220;always&#8221; for the container &amp; the container ID is stored in the variable <strong>container_id.\u00a0<\/strong>Inside \/mnt\/code is your PHP code. The httpd service will start on its own as I already added a <strong>CMD<\/strong> via <strong>Dockerfile<\/strong> i.e.<br \/>\n<strong>ENTRYPOINT [&#8220;\/usr\/sbin\/httpd&#8221;]<\/strong><br \/>\n<strong> CMD [&#8220;-D&#8221;,&#8221;FOREGROUND&#8221;,&#8221;-k&#8221;,&#8221;start&#8221;]<\/strong><br \/>\nor you can use Nginx etc. You might have done this already<\/li>\n<li>Sleep for 5 seconds<\/li>\n<li>The first if statement checks if the container has started &amp; then sends an email to the specified email address according to the result. We are checking that using the command\u00a0<strong>docker inspect -f {{.State.Running}} $container_id` <\/strong>&amp; it should return a string &#8220;true&#8221;. Add a sleep of 20 seconds<\/li>\n<li>Next is checking if the container is serving the website on 80 port. For that we curl localhost:80. If it returns 200 then the website is working else it is not serving the website<\/li>\n<li>Now, since that is working, next is getting sendmail up &amp; running. For that execute the dockersendmail.sh script. This will work as we discussed above.<\/li>\n<\/ol>\n<p>Now, everything should be working fine &amp; your docker container will start when your servers auto-scale.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my previous blog, I talked about setting up sendmail inside a Docker container.\u00a0In this blog, we will talk about how to make your Docker containers come up during Auto-scaling of AWS servers, start, and use a service like sendmail inside them. You can make changes to scripts based on your use-case. I just want [&hellip;]<\/p>\n","protected":false},"author":174,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":16,"footnotes":""},"categories":[1174,2348],"tags":[248,1257,2366,1883,2335,2250,2249,2336],"class_list":["post-26168","post","type-post","status-publish","format-standard","hentry","category-aws-2","category-devops-technology","tag-aws","tag-aws-auto-scaling","tag-aws-devops","tag-docker","tag-docker-autoscaling","tag-docker-centos","tag-docker-exec","tag-docker-sendmail"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"In my previous blog, I talked about setting up sendmail inside a Docker container. In this blog, we will talk about how to make your Docker containers come up during Auto-scaling of AWS servers, start, and use a service like sendmail inside them. You can make changes to scripts based on your use-case. I just want\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Ranvijay Jamwal\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Docker containers and AWS Auto-scaling \u2013 Hand in Hand | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"In my previous blog, I talked about setting up sendmail inside a Docker container. In this blog, we will talk about how to make your Docker containers come up during Auto-scaling of AWS servers, start, and use a service like sendmail inside them. You can make changes to scripts based on your use-case. I just want\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Docker containers and AWS Auto-scaling \u2013 Hand in Hand | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In my previous blog, I talked about setting up sendmail inside a Docker container. In this blog, we will talk about how to make your Docker containers come up during Auto-scaling of AWS servers, start, and use a service like sendmail inside them. You can make changes to scripts based on your use-case. I just want\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/docker-containers-and-aws-auto-scaling-hand-in-hand\\\/#article\",\"name\":\"Docker containers and AWS Auto-scaling \\u2013 Hand in Hand | TO THE NEW Blog\",\"headline\":\"Docker containers and AWS Auto-scaling &#8211; Hand in Hand\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/ranvijayjintelligrape-com\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"\\\/blog\\\/wp-ttn-blog\\\/uploads\\\/2015\\\/09\\\/cicd-with-docker-on-aws-1-638.jpg\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/docker-containers-and-aws-auto-scaling-hand-in-hand\\\/#articleImage\"},\"datePublished\":\"2015-09-14T12:36:17+05:30\",\"dateModified\":\"2016-01-19T13:32:30+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/docker-containers-and-aws-auto-scaling-hand-in-hand\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/docker-containers-and-aws-auto-scaling-hand-in-hand\\\/#webpage\"},\"articleSection\":\"AWS, DevOps, aws, AWS auto scaling, aws devops, docker, docker autoscaling, DOCKER CENTOS, DOCKER EXEC, docker sendmail\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/docker-containers-and-aws-auto-scaling-hand-in-hand\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/aws-2\\\/#listItem\",\"name\":\"AWS\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/aws-2\\\/#listItem\",\"position\":2,\"name\":\"AWS\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/aws-2\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/docker-containers-and-aws-auto-scaling-hand-in-hand\\\/#listItem\",\"name\":\"Docker containers and AWS Auto-scaling &#8211; Hand in Hand\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/docker-containers-and-aws-auto-scaling-hand-in-hand\\\/#listItem\",\"position\":3,\"name\":\"Docker containers and AWS Auto-scaling &#8211; Hand in Hand\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/aws-2\\\/#listItem\",\"name\":\"AWS\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/ranvijayjintelligrape-com\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/ranvijayjintelligrape-com\\\/\",\"name\":\"Ranvijay Jamwal\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/docker-containers-and-aws-auto-scaling-hand-in-hand\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5941d9077cf4781be288e9b7f22d2366b21ecf4f56885bbb891e05a268f7f7dc?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Ranvijay Jamwal\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/docker-containers-and-aws-auto-scaling-hand-in-hand\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/docker-containers-and-aws-auto-scaling-hand-in-hand\\\/\",\"name\":\"Docker containers and AWS Auto-scaling \\u2013 Hand in Hand | TO THE NEW Blog\",\"description\":\"In my previous blog, I talked about setting up sendmail inside a Docker container. In this blog, we will talk about how to make your Docker containers come up during Auto-scaling of AWS servers, start, and use a service like sendmail inside them. You can make changes to scripts based on your use-case. I just want\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/docker-containers-and-aws-auto-scaling-hand-in-hand\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/ranvijayjintelligrape-com\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/ranvijayjintelligrape-com\\\/#author\"},\"datePublished\":\"2015-09-14T12:36:17+05:30\",\"dateModified\":\"2016-01-19T13:32:30+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Docker containers and AWS Auto-scaling \u2013 Hand in Hand | TO THE NEW Blog","description":"In my previous blog, I talked about setting up sendmail inside a Docker container. In this blog, we will talk about how to make your Docker containers come up during Auto-scaling of AWS servers, start, and use a service like sendmail inside them. You can make changes to scripts based on your use-case. I just want","canonical_url":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/#article","name":"Docker containers and AWS Auto-scaling \u2013 Hand in Hand | TO THE NEW Blog","headline":"Docker containers and AWS Auto-scaling &#8211; Hand in Hand","author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/ranvijayjintelligrape-com\/#author"},"publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"\/blog\/wp-ttn-blog\/uploads\/2015\/09\/cicd-with-docker-on-aws-1-638.jpg","@id":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/#articleImage"},"datePublished":"2015-09-14T12:36:17+05:30","dateModified":"2016-01-19T13:32:30+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/#webpage"},"isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/#webpage"},"articleSection":"AWS, DevOps, aws, AWS auto scaling, aws devops, docker, docker autoscaling, DOCKER CENTOS, DOCKER EXEC, docker sendmail"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.tothenew.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/aws-2\/#listItem","name":"AWS"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/aws-2\/#listItem","position":2,"name":"AWS","item":"https:\/\/www.tothenew.com\/blog\/category\/aws-2\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/#listItem","name":"Docker containers and AWS Auto-scaling &#8211; Hand in Hand"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/#listItem","position":3,"name":"Docker containers and AWS Auto-scaling &#8211; Hand in Hand","previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/aws-2\/#listItem","name":"AWS"}}]},{"@type":"Organization","@id":"https:\/\/www.tothenew.com\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/www.tothenew.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.tothenew.com\/blog\/author\/ranvijayjintelligrape-com\/#author","url":"https:\/\/www.tothenew.com\/blog\/author\/ranvijayjintelligrape-com\/","name":"Ranvijay Jamwal","image":{"@type":"ImageObject","@id":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/5941d9077cf4781be288e9b7f22d2366b21ecf4f56885bbb891e05a268f7f7dc?s=96&d=mm&r=g","width":96,"height":96,"caption":"Ranvijay Jamwal"}},{"@type":"WebPage","@id":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/#webpage","url":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/","name":"Docker containers and AWS Auto-scaling \u2013 Hand in Hand | TO THE NEW Blog","description":"In my previous blog, I talked about setting up sendmail inside a Docker container. In this blog, we will talk about how to make your Docker containers come up during Auto-scaling of AWS servers, start, and use a service like sendmail inside them. You can make changes to scripts based on your use-case. I just want","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/#breadcrumblist"},"author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/ranvijayjintelligrape-com\/#author"},"creator":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/ranvijayjintelligrape-com\/#author"},"datePublished":"2015-09-14T12:36:17+05:30","dateModified":"2016-01-19T13:32:30+05:30"},{"@type":"WebSite","@id":"https:\/\/www.tothenew.com\/blog\/#website","url":"https:\/\/www.tothenew.com\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Docker containers and AWS Auto-scaling \u2013 Hand in Hand | TO THE NEW Blog","og:description":"In my previous blog, I talked about setting up sendmail inside a Docker container. In this blog, we will talk about how to make your Docker containers come up during Auto-scaling of AWS servers, start, and use a service like sendmail inside them. You can make changes to scripts based on your use-case. I just want","og:url":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/","og:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Docker containers and AWS Auto-scaling \u2013 Hand in Hand | TO THE NEW Blog","twitter:description":"In my previous blog, I talked about setting up sendmail inside a Docker container. In this blog, we will talk about how to make your Docker containers come up during Auto-scaling of AWS servers, start, and use a service like sendmail inside them. You can make changes to scripts based on your use-case. I just want","twitter:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"26168","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"blog","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 12:56:15","updated":"2024-02-29 08:41:23","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\/category\/aws-2\/\" title=\"AWS\">AWS<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tDocker containers and AWS Auto-scaling \u2013 Hand in Hand\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.tothenew.com\/blog"},{"label":"AWS","link":"https:\/\/www.tothenew.com\/blog\/category\/aws-2\/"},{"label":"Docker containers and AWS Auto-scaling &#8211; Hand in Hand","link":"https:\/\/www.tothenew.com\/blog\/docker-containers-and-aws-auto-scaling-hand-in-hand\/"}],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/26168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/174"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=26168"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/26168\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=26168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=26168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=26168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}