Get Started, Part 6: Deploy your app
Estimated reading time: 7 minutesPrerequisites
- Install Docker version 1.13 or higher.
- Get Docker Compose as described in Part 3 prerequisites.
- Get Docker Machine as described in Part 4 prerequisites.
- Read the orientation in Part 1.
Learn how to create containers in Part 2.
Make sure you have published the
friendlyhello
image you created by pushing it to a registry. We’ll be using that shared image here.Be sure your image works as a deployed container. Run this command, slotting in your info for
username
,repo
, andtag
:docker run -p 80:80 username/repo:tag
, then visithttp://localhost/
.- Have the final version of
docker-compose.yml
from Part 5 handy.
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
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
You can run Docker Cloud in standard mode or in Swarm mode.
If you are running Docker Cloud in standard mode, follow instructions below to link your service provider to Docker Cloud.
- Amazon Web Services setup guide
- DigitalOcean setup guide
- Microsoft Azure setup guide
- Packet setup guide
- SoftLayer setup guide
- Use the Docker Cloud Agent to Bring your Own Host
If you are running in Swarm mode (recommended for Amazon Web Services or Microsoft Azure), then skip to the next section on how to create your swarm.
Create your swarm
Ready to create a swarm?
If you’re on Amazon Web Services (AWS) you can automatically create a swarm on AWS.
If you are on Microsoft Azure, you can automatically create a swarm on Azure.
Otherwise, create your nodes in the Docker Cloud UI, and run the
docker swarm init
anddocker 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 created.
Note: If you are Using the Docker Cloud Agent to Bring your Own Host, this provider does not support swarm mode. You can register your own existing swarms with Docker Cloud.
Deploy your app
Connect to your swarm via Docker Cloud. On Docker for Mac or Docker for Windows (Edge releases), you can connect to your swarms directly through the desktop app menus.
Either way, this opens a terminal whose context is your local machine, but whose Docker commands are routed up to the swarm running on your cloud service provider. This is a little different from the paradigm you’ve been following, where you were sending 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.
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
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. You can also view the WIP guide for Microsoft Azure.
Once you’re all set up and Datacenter is running, you can deploy your Compose file from directly within the UI.
After that, you’ll see it running, and can change any aspect of the application you choose, or even edit the Compose file itself.
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
Bringing your own server to Docker Enterprise and setting up Docker Datacenter essentially involves two steps:
- Get Docker Enterprise Edition for your server’s OS from Docker Store.
- Follow the instructions to install Datacenter on your own host.
Note: Running Windows containers? View our Windows Server setup guide.
Once you’re all set up and Datacenter is running, you can deploy your Compose file from directly within the UI.
After that, you’ll see it running, and can change any aspect of the application you choose, or even edit the Compose file itself.
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.