In this post we are showing you how to deploy the Ghost blogging platform in a Docker Container on any cloud using Cloud Application Manager, digging deeper into Docker as a Service, one of the latest Cloud Application Manager features released in Cloud Application Manager. The following step-by-step instructions will teach you how to build a Box that will allow you to deploy an instance right away. If you haven’t already signed up for Cloud Application Manager, create your account to get started.

Deploying Ghost in a Docker Container

In this tutorial, we will be showing you how to launch and instance of Ghost, a simple but powerful publishing platform, in a Docker Container on the Cloud Provider of your choice. By the end, you will have built a Ghost / Docker Box in Cloud Application Manager that can be deployed, versioned and shared.

1) Setting Up Dockerfile

As a first step, we need to get the Dockerfile required to deploy the Ghost service in a Docker Container. You can find the required commands and information on the Ghost Repository on Docker Hub.

Download the trusted Build Bundle from the Docker Ghost Repository, you’ll be needing that file in just a few minutes.

ghost1

2) Create a Ghost Box

The next step is to create a new Box in Cloud Application Manager and make sure to use Docker as the selected ‘Service.’

ghost2

3) Upload the Ghost Dockerfile

Once your Box has been created, upload the Ghost Dockerfile you just downloaded from Docker Hub.

ghost3

Every time you save a Dockerfile, Cloud Application Manager will parse the template looking for EXPOSE commands. For every match, Cloud Application Manager creates a port variable and modifies the Dockerfile according to Jinja syntax. In this case, Cloud Application Manager will create a port variable called expose_2368. The result will look like: EXPOSE {{ expose_2368 }}

After all these steps, your Ghost Box should look like the screenshot below!

ghost4

Hint: You won’t be able to deploy the Box just yet because it doesn’t have access to the files included with the ADD commands in the Dockerfile.

4) Add Additional Scripts

Add all the additional files as file variables. In the current case add the file ‘start.bash’ and call it START_BASH (the file is located within the Build Bundle). We also marked the file variable as required because it has to be included during the deployment phase.

Click the ‘New Variable’ button in the Box view and select the ‘File’ option from the dialog that pops up. Name the file ‘START_BASH’. Then, upload the start.bash file from the Docker Build Bundle you just downloaded.

ghost5

5) Add a New Path in the Dockerfile

Head back to box and edit the Docker file to add a substitute local path using the Jinja syntax: {{ variable_name}}

It should look like: ADD {{ START_BASH }} /ghost-start

ghost6

6) Deploy the Box on any Provider!

Congrats! You’ve built a Ghost Docker Box which you can now deploy on any provider that’ve added in Cloud Application Manager. For more information on deploying instances in Cloud Application Manager, please visit our documentation on that subject.

Want to Learn More About Cloud Application Manager and ElasticKube?

Cloud Application Manager is a powerful, scalable platform for deploying applications into production across any cloud infrastructure – private, public or hosted. It provides interactive visualization to automate application provisioning, including configuration, deployment, scaling, updating and migration of applications in real-time. Offering two approaches to cloud orchestration — Cloud Application Manager and ElasticKube — enterprise IT and developers alike can benefit from multi-cloud flexibility.

Explore ElasticKube by visiting GitHub (curl -s https://elastickube.com | bash).

Visit the Cloud Application Manager product page to learn more.