This is documentation for Apprenda 7 and 8.
Documentation for older versions are also available.

Configure Support for Docker Workloads

This page describes how to enable Docker container deployments on your Platform. This includes configuring your Docker installations and creating the necessary Custom Properties and Application Bootstrap Policy on your Platform.

Before you begin, you should have a thorough understanding of Docker, Platform application deployment, and Platform terminology.

After configuring your Platform for Docker, learn about deploying and managing Docker workloads on the Platform.

Software Requirements

  • Platform version 6.5.3 or later installed
  • One or more CentOS/RHEL 7 Linux servers added to the Platform. Linux OS requirements for Linux Servers that host Docker Workloads must meet both the prerequisites for the Platform and those for the version of Docker that will be installed
  • Docker 1.13 or 17.03 installed and configured on any Platform Linux Servers that will host Docker Workloads. Docker may be installed on existing Platform Linux servers, or Docker can be set up prior to Platform installation. Docker installation information can be found at https://docs.docker.com/engine/installation/.

Configuration Requirements

  • Set Docker to start on system boot. Docker must be explicitly set to restart on machine reboot to ensure that the service always turns on after a machine reboots.
  • Set iptables to start on system boot. Docker relies on iptables for routing some traffic from the host Linux node to the virtual Docker container.
  • Internet/Docker Registry access on Linux servers. Linux nodes require networking to permit pulling images from a public Docker repository. It should be noted that it may take some time to pull a new, previously unused Docker image from the central Docker registry to the Linux node.
  • Linux nodes must have sufficient disk space to store Docker images.
  • The Docker daemon will need to be configured at start up with the following option. Also see Docker's documentation on changing runtime options for more information. If you plan to use overlay networking, you will also need the configuration options shown in the next bullet.
--exec-opt native.cgroupdrive=systemd 
  • For overlay networking, the Docker engine(s) must be configured with an external key-value store. See Docker's documentation on overlay networking with an external key-value store for more information. Note that Swarm Mode is not supported with this setup and a Swarm Cluster should not be created. The ExecStart options would look like the following:
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon --exec-opt native.cgroupdriver=systemd \
  --cluster-store=etcd://<node1IP>:2379,<node2IP>:2379,<node3IP>:2379 \
  --cluster-advertise=ens160:2375

Required Custom Property Setup

Custom Properties are used to define characteristics about applications, servers, and other Platform objects that will affect how the Platform behaves for that object. For Docker deployments, Custom Properties are used to define Docker configuration options used by the local Docker instance to deploy your application. You must create the Custom Properties used for Docker container deployments in the SOC before they can be used.

For a basic Docker deployment, you only need to set the DockerDeploy and DockerImageName Custom Properties for an application. There are several more Custom Properties that you can add to your Platform that will allow you additional configuration options. See the Docker Configuration Custom Properties page for a list configuration options.

Docker Deploy

DockerDeploy determines if an application is deployed with Docker. The setting can be No or Registry. If No, the application is deployed as normal Linux Service on the Platform. If Registry, the application will trigger the Docker Deployer Bootstrap Policy and is deployed with Docker.

The table below shows the setup configuration for the Docker Deploy property. Create it from the Configuration>Custom Properties page in the SOC.

Optionally, you can also use this Custom Property to distinguish Linux servers to use for Docker deployments if only a subset of your Linux servers are configured for Docker. You can set up this server tagging by creating an Application Deployment Policy. If you wish to use this Custom Property for tagging Linux servers for Docker deployments, also make sure Docker Deploy Applies to: Compute Servers (allow multi-select).

Docker Deploy Custom Property

General Settings
Name DockerDeploy
Display Name Docker Deploy
Description Tag that denotes an application should be deployed with Docker.
Allowed Values No, Registry
Applies to: Applications
Default Value(s) No
Application Settings
Scope Application Component Level: Linux Services
Developer Visibility
Visible to Developers Yes
Required for Deployment Yes
Editable by Developers Yes

 

Docker Image Name

The Docker Image Name property is the name of the image to use for the container. The value for this setting must include both the registry that holds the image and the name of the image. The name is passed to the Docker run command for container start-up. If needed, Docker will pull the image from the registry you configured for the Docker instance on the server where the container is being deployed.

The table below shows the setup configuration for the Docker Image Name property. Create it from the Configuration>Custom Properties page in the SOC.

Docker Image Name Custom Property

General Settings
Name DockerImageName
Display Name Docker Image Name
Description Name of the image to deploy container
Allowed Values Allow custom values
Applies to: Applications
Application Settings
Scope Application Component Level: Linux Services
Developer Visibility
Visible to Developers Yes
Required for Deployment Yes
Editable by Developers Yes

Required Application Bootstrap Policy Creation

An Application Bootstrap Policy is used to detect workloads that should be deployed using Docker.

Download docker-registry-deployer ZIP files

Create the following Application Bootstrap Policy on the Platform before you can deploy with Docker.

Docker Deploy Bootstrap Policy

General Settings
Name Docker Deploy Bootstrap Policy
Description  
Active Policy Yes
Applies to Linux Application Components
Bootstrap Type Applied Per Instance
Application Stage Sandbox
Published
Bootstrap Libraries Run a custom workflow for deployments using the
provided docker-registry-deployer ZIP file
Conditions Bootstrap only if the component being deployed satisfies
Component Type Linux Services
Custom Property Docker Deploy
Comparison Logic Contain All
Value(s) Registry

Application Deployment Policy and Server Tagging

In cases where not all Platform Linux servers are configured to support Docker, the following Application Deployment Policy is required to ensure that Docker Workloads are deployed to Linux Servers where Docker has been installed:

Docker Deploy Application Deployment Policy

General Settings
Name Docker Deployment Policy
Description Deploys Docker Workloads to properly configured
Linux Servers
Active Policy Yes
Applies to Sandbox
Published
Source Object
Source Object Linux Services
Source Property Docker Deploy
Comparison Logic Must Contain Any

The Docker Deploy Custom Property can tag servers that should be used for Docker deployments. On all Linux servers that support Docker, set the Docker Deploy Custom Property through the Infrastructure>Servers section of the SOC. If you wish to use this Custom Property for tagging Linux servers for Docker deployments, make sure Docker Deploy is configured to apply to compute servers and multi-select is allowed for compute servers.  

To configure the server to host Docker workloads only, set the value to Registry. To allow the server to host other types of Linux workloads (such as generic Linux Services workloads), set the value to Registry,No. If the server cannot support Docker Workloads, the value should be left at the default of No.