Skip to main content

Deploy Containers to AWS using Docker ECS Plugin

Deploy Containers to AWS using Docker ECS Plugin

Deploy Containers to AWS using Docker ECS Plugin

Containers are good, we love them. Amazon Elastic Container Service(ECS) is also good, and we like it, but the least likable aspects of…

Deploy Containers to AWS using Docker ECS Plugin

Containers are good, we love them. Amazon Elastic Container Service(ECS) is also good, and we like it, but the least likable aspects of ECS are deployments and creating necessary resources on AWS. Docker recently announced ECS integration through a new plugin that integrates Docker CLI and AWS seamlessly. For this tutorial, we are going to deploy WordPress installation using only Docker CLI with the help of the new ECS plugin.

The new plugin is only available in Docker edge releases.
https://www.docker.com/products/docker-desktop

Let’s start by describing the Docker Compose template that we are going to use. We will be using the necessary Docker images from Bitnami.

Now we can set the ECS plugin, before that, we have to agree on the new ARN format for ECS on AWS. ECS plugin depends on the new format, and if you didn’t agree with the new ARN changes, you won’t be able to install the plugin correctly.

https://console.aws.amazon.com/ecs/home?#/settings

Next step, setting up the ECS plugin. I chose an existing AWS profile named admin here. You have to choose the same account that you agree on ARN changes.

We need to switch to using the new context.

All good. We can start with the deployment.

Docker ECS plugin uses Cloudformation under the hood, we can check which resources are created by checking the Cloudformation console.

We can get the running services via Docker CLI

Logs are stored in Cloudwatch, we can get it either via Docker CLI command or through Cloudwatch console.

Head over to EC2 console and go to the Load Balancing section, there you should able to see the Load Balancer created by the ECS plugin.

Copy the DNS name and try to visit the port 8080 where WordPress service is running.

Brilliant and all of these things are managed by Docker CLI, no need to install anything. You can also use images that are hosted in Docker Hub or the images hosted on Amazon Elastic Container Registry (ECR).

After you are done with this tutorial, don’t forget to remove the resources.


Although this a beta feature for Docker CLI and it is still in the development process, we will keep an eye on future developments and update our readers as the project evolves.

Popular posts from this blog

Concurrency With Boto3

Concurrency with Boto3 Concurrency with Boto3 Asyncio provides set of tools for concurrent programming in Python. In a very simple sense it does this by having an event loop execute a… Concurrency in Boto3 Asyncio provides a set of tools for concurrent programming in Python . In a very simple sense, it does this by having an event loop execute a collection of tasks, with a key difference being that each task chooses when to yield control back to the event loop. Asyncio is a good fit for IO-bound and high-level structured network code. Boto3 (AWS Python SDK) falls into this category. A lot of existing libraries are not ready to be used with asyncio out of the box. They may block, or depend on concurrency features not available through the module. It’s still possible to use those libraries in an application based on asyncio by using an executor from concurrent.futures to run the code either in a separate thread or a separate process. The run_in_executor() method of the event...

Manage MongoDB Atlas Deployments with AWS CDK

Manage MongoDB Atlas Deployments with AWS CDK Manage MongoDB Atlas Deployments with AWS CDK MongoDB Atlas is a fully-managed cloud-based database service offered by MongoDB. It offers a variety of features such as automatic… Manage MongoDB Atlas Deployments with AWS CDK MongoDB Atlas is a fully-managed cloud-based database service offered by MongoDB. It offers a variety of features such as automatic backups, automatic scaling, and easy integration with other cloud services. AWS Cloud Development Kit(CDK) is a tool provided by Amazon Web Services (AWS) that allows you to define infrastructure as code using familiar programming languages such as TypeScript, JavaScript, Python, and others. MongoDB recently announced general availability for Atlas Integrations for AWS CloudFormation and CDK. In this article, we will go through the process of deploying MongoDB Atlas with AWS CDK. Prerequisites Before we start, you will need the following: An AWS account AWS CDK installed on your lo...

AWS Lambda Function URLs

AWS Lambda Function URLs AWS Lambda Function URLs AWS Lambda is a Serverless computing service offered by Amazon Web Services (AWS) that allows developers to run code without provisioning… AWS Lambda Function URLs AWS Lambda AWS Lambda is a Serverless computing service offered by Amazon Web Services ( AWS ) that allows developers to run code without provisioning or managing servers. In this tutorial, we will explore AWS Lambda Function URLs , which are the endpoints that allow you to invoke your Lambda functions. AWS Lambda Function URLs are unique HTTP endpoints that you can create using AWS Console, SDK or any other IaC tool. These URLs are used to trigger your Lambda function, and they can be integrated with a variety of workloads. Function URLs are dual stack-enabled, supporting IPv4 and IPv6. After you configure a function URL for your function, you can invoke your function through its HTTP(S) endpoint via a web browser, curl, Postman, or any HTTP client. Once you create ...