Docker Project (v3.5)

A simple project to deploy and run a dockerised application

Project overview.

Here is a summary of what this project will achieve.

This project is designed to download an image from Docker hub, and run it in a container. The server in the project is Linux, but can also be Windows if required. 

One target environment is configured in the project (for Linux). We can easily clone this project to add a Windows flavour.

In this project, most configuration is done on the environment panel and this is exported to the projects that consume it.

The Docker plugin we are using is based on the Docker command line.

What is preconfigured and demonstrated

The project demonstrates the following configurations:
  • Target server for Linux using localhost
  • Use of the Remote agent plugin
  • Configured environment for a Wordpress image and configuration
  • DockerRunContainerTask task

Prerequisites

  • You will need Docker installed on both the RapidDeploy server and any target infrastructures you want to deploy to.
  • Docker configurations on the targets should allow remote connections. Please record the URL and port of the remote docker instances as these will need configuring in RapidDeploy.
  • You should have the ability to connect to the target server on the port specified above. Ensure there are no firewall rules blocking access between the RapidDeploy server and the target Docker instances.

How to use this project.

  1. Download the project to your desktop by clicking on one of the links. The file will be saved as Docker-Wordpress.zip
  2. Log into your RapidDeploy instance as mvadmin.
  3. Navigate to Resources-> Projects.
  4. In the top right hand corner click on the Upload Project button.
  5. Select the zip file you downloaded in step 1.
  6. You are guided through a project import wizard. The important thing to check and change (if necessary) here is the path to the project storage directory.
  7. Once the project is imported, there are a couple of things youll need to do.
    • This project is run on a server definition for localhost. Leave this as-is as localhost is just used to stage the deployment to the docker instance.
    • You will need to introduce credentials to authenticate to Docker Hub.
    • To do this navigate to   Resources  ->   Targets   ->   Environments
    • Select the Wordpress  environment. Edit the environment. 
    • On the Product  tab navigate down to the Docker Credentials panel and enter your credentials. 
    • Make sure the Docker Host Environment Variable  is set to the host/port of the Docker instance, gathered in the prerequisite section.
    • Save the environment. Be sure to check the Write Environment Data to all associated projects.
    • Now we have saved the environment, which exports a definition to our project, navigate to    Resources  ->    Projects   and edit the project. Navigate to the    Packages   tab and click the    Create Package    button. A new package is created with a version number. This is the package you'll deploy later, containing all the environment definitions, actions and paylod to allow the jobs to be run on all defined servers.
  8. Now you can run a new job to the environment of your choice. 
    • Navigate to Jobs-> New Job
    • Select the project you created earlier. You will see a tree view of server/environment and application. 
    • Select the one you want to deploy and follow the wizard. 
    • On the Version panel you select the version (package version) you want to deploy. 
    • Since there is only one package, it is preselected. The latest package will always be preselected by default. 
    • Click on the Skip to Finish checkbox and click Next
    • On the final tab click the Start Job button. The deployment is started and you see the tasks executed and job log in real time.

Further Reading

The following links will help you gain a deeper understanding of the tasks used in this project:

Download this project!