The Docker's Power in the Cloud

DZone 's Guide to

The Docker's Power in the Cloud

In just this brief contact with the Docker Cloud, I could see that this tool can make life easier when we want work with Docker integrated with AWS.

· Cloud Zone ·
Free Resource

Docker Cloud is a hosted service for Docker container. With Docker Cloud, it is possible to do management, orchestration, and deployment of the container in some Cloud Providers. These types of products are classified with as CAAS, Container-as-a-Service. It was acquired by Docker

Some features available in the Docker Cloud include:

  • Provision Docker installed infrastructure
  • Manage node clusters
  • Pull images from Docker Hub 
  • Deploy containers across nodes
  • Monitor and scale applications
  • Continuos Integration
  • Continuos Delivery
  • Client: HTTP, Command Line Interface, Go, Python, UI DashBoard

It is possible to create, deploy, and manage applications as well as start, restart, and destroy containers. These services are free for just one private repository and one parallel build. The cloud providers available are Amazon Web Service, Digital Ocean, Microsoft Azure, SoftLayer, and Packet.

To use Docker Cloud for the first time is very easy. There is a that shows step-by-step what it should do like and how to link a cloud provider, deploy a node, create a service, create a stack, and use the image repository from Docker Hub. All these steps are itemized with a hint on each label.

How Does It Work?

In my test, I used the cloud provider AWS:

Image title

Under Create a stack,  I picked up one option offered by Stackfiles with Redis.

Image title

When I clicked "create," the Stack that I chose appeared, listing the container that would be deployed.

The next step was creating the Node Cluster. This node cluster is one EC2 in AWS. In this, EC2 will be installed by a Docker machine, and in this Docker machine, the containers will be deployed.

At the end of this step, this Node Cluster will be shown with State running in Docker Cloud Node panel and Running in AWS Console.

Image title

Be careful because the Security Group is blank by default. This means that the TCP connection is inbound and opened in all ports.

Image title

Now it is possible to start the container available the Stack Panel.

If you click in the container with web, it is possible to click to see the application web running.

Image title

Another option to deploy or manage containers is by command line interface, which can be done in these steps:

  1. Install Docker-cloud (Mac OS: brew install docker-cloud; Unix: pip install docker-cloud).

  2. Docker login > Docker Hub account.

  3. Mkdir devops-cafe > create dir to DockerFile and code.

  4. Main.go > code that produces hello world in for 80.

Image title5. Create DockerFile.

Image title

6. Create Docker Compose.

Image title

7. Docker build: -t devops-cafe.
8. Docker tag: devops-cafe rafaelsalerno/devops-cafe.
9. Docker push: rafaelsalerno/devops-cafe.
10. Docker-cloud service: run -p --name web rafaelsalerno/devops-cafe (after this command, the container should be running).

Image title

11. Docker-cloud container ps --no-trunc --service web (check that the containers are running).

Image title

12. Docker-cloud service scale web 2; deploy two more containers with the same application.

Image title

In just this brief contact with the Docker Cloud, I could see that this tool can make life easier when we want work with Docker integrated with AWS. The command line is powerful and the Dashboard is simple and objective to work.

aws, aws ec2, cloud, docker

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}