BT

InfoQ Homepage News Docker Releases Plugin for Simplified Deployments into AWS ECS and Fargate

Docker Releases Plugin for Simplified Deployments into AWS ECS and Fargate

This item in japanese

Bookmarks

Docker has announced the public beta of their enhanced integration of Docker with AWS Elastic Container Service and AWS Fargate. The release of the ECS plugin allows for developers to work within the Docker experience to create the necessary infrastructure to operate within AWS.

The current beta user experience requires the use of the ecs syntax in Docker commands as the plugin is being leveraged directly in the short term. For example, executing docker ecs compose up will create the application and all resources needed within AWS as described within the compose.yaml file. This removes the need to separately create the AWS ECS resources that are not part of the Compose specification such as VPCs, ECS clusters, and ECS task definitions.

The ECS Docker plugin requires an AWS profile to be set up to select the necessary AWS API credentials from. Once created, the AWS profile and region are stored within the Docker context. This can be initiated via the docker ecs setup command.

The plugin will parse the compose.yaml file and convert it into the appropriate CloudFormation template. This template is then used to create the application resources in the prescribed order. Resources can be cleaned up via the down command or will be automatically cleaned up in the event of a deployment failure.

The ECS integration executes a four-step process. The Load phase relies on compose-go to load and parse the compose.yaml file. In the Validate phase, ECS defaults are injected into the compose-go model and the compose.yaml file is validated to ensure it does not include unsupported features. The Convert phase produces a CloudFormation template that defines all the application resources needed to implement the application model on AWS. Finally, the Apply phase does the apply of the CloudFormation template, either by exporting to a stack file or to deploy on AWS.

The Compose services are mapped to ECS services during this process. Since Compose doesn't support multi-container services, such as Kubernetes pods or sidecars, a custom Compose extension (i.e. x-aws-*) is used to expose ECS features as a service-level feature.

The network abstraction is mapped from the Compose model into AWS security groups. The application is created within a single VPC with security groups being created per Compose network, including the implicit default one. Services are then attached according to how the networks are declared in the Compose model. This enables services attached to a common security group to communicate with each other.

A Cloud Map private namespace is also created for each application as {project}.local. AWS Cloud Map is a resource discovery service. It allows for the registration of any application resources with custom names. Cloud Map will then check the health of registered resources to ensure their location is up-to-date.

The GA release is expected later this year and will move the plugin into being part of Docker Contexts. Docker Contexts provide a way for a single CLI instance to have multiple contexts. Each context contains all the necessary endpoints and security information required to manage the cluster or node. For example, there could be a developer context and a production context on the same laptop. The command docker context use <context-name> can be used to switch between contexts.

To get started, a Docker ID is needed along with Docker Desktop Edge version 2.3.3.0. There is a demo application available within the GitHub repo. Docker is also looking for feature requests to be submitted to the roadmap.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • AWS Elastic Container Service and AWS Fargate

    by Oz Kologlu /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    I thought I'd give it a go - it's a good concept but still does seem pretty Beta at this point.

    There is very little documentation/information at this point and some things are quite vague.

    I'm not quite sure if this works with both Fargate and EC2 or just Fargate?
    EC2 is in the works: github.com/docker/roadmap/issues/131
    I want to use a pre-defined cluster it looks like the plugin will create it's own cluster/service (not 100% sure) eg:
    When trying to deploy a container I got "account has not default VPC" - (yes, I could set the default VPC but) why would a it need a default VPC if deploying to an existing cluster and so figured it must want to create a new cluster - I haven't checked the code.

    Still early days I suppose - will keep an eye on it.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.