Skip to content

Latest commit

 

History

History
175 lines (134 loc) · 9.49 KB

part6.md

File metadata and controls

175 lines (134 loc) · 9.49 KB
title keywords description
Get Started, Part 6: Deploy your app
deploy, production, datacenter, cloud, aws, azure, provider, admin, enterprise
Deploy your app to production using Docker CE or EE.

{% include_relative nav.html selected="6" %}

Prerequisites

Introduction

You've been editing the same Compose file for this entire tutorial. Well, we have good news. That Compose file works just as well in production as it does on your machine. Here, we'll go through some options for running your Dockerized application.

Choose an option

{% capture cloud %} If you're okay with using Docker Community Edition in production, you can use Docker Cloud to help manage your app on popular service providers such as Amazon Web Services, DigitalOcean, and Microsoft Azure.

To set up and deploy:

  • Connect Docker Cloud with your preferred provider, granting Docker Cloud permission to automatically provision and "Dockerize" VMs for you.
  • Use Docker Cloud to create your computing resources and create your swarm.
  • Deploy your app.

Note: We will be linking into the Docker Cloud documentation here; be sure to come back to this page after completing each step.

Connect Docker Cloud

First, link Docker Cloud with your cloud provider:

Create your swarm

After your cloud provider is all set up, create a Swarm:

  • If you're on Amazon Web Services (AWS) you can automatically create a swarm{: onclick="ga('send', 'event', 'Get Started Referral AWS', 'Cloud', 'Create AWS Swarm');"}.

  • If you are on Microsoft Azure, you can automatically create a swarm{: onclick="ga('send', 'event', 'Get Started Referral Azure', 'Cloud', 'Create Azure Swarm');"}.

  • Otherwise, create your nodes{: onclick="ga('send', 'event', 'Get Started Referral', 'Cloud', 'Create Nodes');"} in the Docker Cloud UI, and run the docker swarm init and docker swarm join commands you learned in part 4 over SSH via Docker Cloud. Finally, enable Swarm Mode by clicking the toggle at the top of the screen, and register the swarm you just made.

Deploy your app

Connect to your swarm via Docker Cloud. This opens a terminal whose context is your local machine, but whose Docker commands are routed up to the swarm running on your cloud provider. This is a little different from the paradigm you've been following, where you were slinging commands via SSH; now, you can directly access both your local file system and your remote swarm, enabling some very tidy-looking commands:

docker stack deploy -c docker-compose.yml getstartedlab

That's it! Your app is running in production and is managed by Docker Cloud. {% endcapture %} {% capture enterpriseboilerplate %} Customers of Docker Enterprise Edition run a stable, commercially-supported version of Docker Engine, and as an add-on they get our first-class management software, Docker Datacenter. You can manage every aspect of your application via UI using Universal Control Plane, run a private image registry with Docker Trusted Registry, integrate with your LDAP provider, sign production images with Docker Content Trust, and many other features.

Take a tour of Docker Enterprise Edition{: class="button outline-btn" onclick="ga('send', 'event', 'Get Started Referral', 'Enterprise', 'Take tour');" style="margin-bottom: 30px; margin-right:58%"} {% endcapture %} {% capture enterprisedeployapp %} Once you're all set up and Datacenter is running, you can deploy your Compose file from directly within the UI{: onclick="ga('send', 'event', 'Get Started Referral', 'Enterprise', 'Deploy app in UI');"}.

Deploy an app on DDC

After that, you'll see it running, and can change any aspect of the application you choose, or even edit the Compose file itself.

Managing app on DDC {% endcapture %} {% capture enterprisecloud %} {{ enterpriseboilerplate }}

The bad news is: the only cloud providers with official Docker Enterprise editions are Amazon Web Services and Microsoft Azure.

The good news is: there are one-click templates to quickly deploy Docker Enterprise on each of these providers:

Note: Having trouble with these? View our setup guide for AWS{: onclick="ga('send', 'event', 'Get Started Referral', 'Enterprise', 'AWS setup guide');"}. You can also view the WIP guide for Microsoft Azure{: onclick="ga('send', 'event', 'Get Started Referral', 'Enterprise', 'Azure setup guide');"}.

{{ enterprisedeployapp }} {% endcapture %} {% capture enterpriseonprem %} {{ enterpriseboilerplate }}

Bringing your own server to Docker Enterprise and setting up Docker Datacenter essentially involves two steps:

  1. Get Docker Enterprise Edition for your server's OS from Docker Store{: onclick="ga('send', 'event', 'Get Started Referral', 'Enterprise', 'Get Docker EE for your OS');"}.
  2. Follow the instructions to install Datacenter on your own host{: onclick="ga('send', 'event', 'Get Started Referral', 'Enterprise', 'BYOH setup guide');"}.

Note: Running Windows containers? View our Windows Server setup guide{: onclick="ga('send', 'event', 'Get Started Referral', 'Enterprise', 'Windows Server setup guide');"}.

{{ enterprisedeployapp }} {% endcapture %}

{{ cloud }}
{{ enterprisecloud }}
{{ enterpriseonprem }}

Congratulations!

You've taken a full-stack, dev-to-deploy tour of the entire Docker platform.

There is much more to the Docker platform than what was covered here, but you have a good idea of the basics of containers, images, services, swarms, stacks, scaling, load-balancing, volumes, and placement constraints.

Want to go deeper? Here are some resources we recommend:

  • Samples: Our samples include multiple examples of popular software running in containers, and some good labs that teach best practices.
  • User Guide: The user guide has several examples that explain networking and storage in greater depth than was covered here.
  • Admin Guide: Covers how to manage a Dockerized production environment.
  • Training: Official Docker courses that offer in-person instruction and virtual classroom environments.
  • Blog: Covers what's going on with Docker lately.