Docker Connector for Anypoint Platform: An Overview

DZone 's Guide to

Docker Connector for Anypoint Platform: An Overview

In this post, we give you an overview of Docker Connector and how you can configure your Docker Connectors to use in your Mule flows.

· Integration Zone ·
Free Resource

The Anypoint Connector for Docker lets you connect to the Docker engine and Docker registry. It exposes convenient methods for using different operations provided by Docker.

Docker Connector functions within a Mule application. Using the connector, your application can perform several operations that Docker exposes via their APIs. When building an application that uses Docker you don’t have to go through the effort of custom-coding (and securing!) a connection in a Mule flow. Rather, you can just drop a Docker connector into your flow, configure a few connection details, and you are ready to use the Docker engine for a Mule flow.

The real value of the Docker connector is in the way you use it at design-time in conjunction with other functional features available in Mule like Data Sense and transform message.

  • DataSense: Extracts metadata from the Docker response to automatically determine the data type and format that your application must deliver to, or can expect from Docker. Mule does the heavy lifting of discovering the type of data you must send to or be prepared to receive from Docker.
  • Transform Message Component: This component’s integrated scripting language called DataWeave can automatically extract response metadata that you can use to visually map and/or transform to a different data format or structure. Essentially, DataWeave lets you control the mapping between data types. For example, if you configure a Docker connector in your application, then drop a Transform Message component after the connector, the component uses DataWeave to gather information that DataSense extracted to pre-populate the input values for mapping. In other words, DataSense makes sure that DataWeave knows the data format and structure it must work with so you don’t have to figure it out manually.

Connection Configurations

The connector provides HTTP and HTTPS connection configurations to interact with the Docker host.

If the Docker engine on the host is running on HTTP, choose the Docker: HTTP Docker Config or else select Docker: HTTPS Docker Config as shown below.

A) HTTP Configurations

The basic HTTP configurations expect a Docker hosted IP or domain name, a port on which the Docker engine is running, and the Docker API version.

B) HTTPS Configurations

The only difference between the HTTP and HTTPS configurations is the certificate directory path. If the Docker engine of the host is running on HTTPS then it is required to provide the client certificates to initiate the connection from the Mule flow.

Operations Supported by the Docker Connector

Docker Info

Pull Image

Create Container

Start Container

Stop Container

Inspect Container

Run Container

Get Container Logs

Get Container Statistics

Restart Container

Kill Container

Pause Container

Unpause Container

Delete Container

List Images

Build Image from Dockerfile

Inspect Image

Remove Image

List Volumes

Wait for a Container

Create Volume

Inspect Volume

Remove Volume

Tag Image

Push Image

My idea for this post was to give you all an overview of Docker Connector and how you can configure them to use in your Mule flows. I hope this article helps you to understand the features and operations of Docker Connector.

anypoint connectors, connectors, docker, integration, mulesoft

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}