Table of Contents
Available as of Camel 2.15
Camel component for communicating with Docker.
The Docker Camel component leverages the docker-java via the Docker Remote API.
docker://[operation]?[options]
Where operation is the specific action to perform on Docker.
The Docker component supports 1 options which are listed below.
{% raw %}
| Name | Java Type | Description |
|---|---|---|
configuration |
| To use the shared docker configuration |
{% endraw %}
The Docker component supports 20 endpoint options which are listed below:
{% raw %}
| Name | Group | Default | Java Type | Description |
|---|---|---|---|---|
operation | common |
| Required Which operation to use | |
common |
| Email address associated with the user | ||
host | common |
|
| Required Docker host |
port | common |
|
| Required Docker port |
requestTimeout | common |
| Request timeout for response (in seconds) | |
bridgeErrorHandler | consumer |
|
| Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored. |
exceptionHandler | consumer (advanced) |
| To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored. | |
exchangePattern | consumer (advanced) |
| Sets the exchange pattern when the consumer creates an exchange. | |
followRedirectFilter | advanced |
|
| Whether to follow redirect filter |
loggingFilter | advanced |
|
| Whether to use logging filter |
maxPerRouteConnections | advanced |
|
| Maximum route connections |
maxTotalConnections | advanced |
|
| Maximum total connections |
serverAddress | advanced |
| Server address for docker registry. | |
socket | advanced |
|
| Socket connection mode |
synchronous | advanced |
|
| Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). |
certPath | security |
| Location containing the SSL certificate chain | |
password | security |
| Password to authenticate with | |
secure | security |
|
| Use HTTPS communication |
tlsVerify | security |
|
| Check TLS |
username | security |
| User name to authenticate with |
{% endraw %}
All URI option can be passed as Header properties. Values found in a message header take precedence over URI parameters. A header property takes the form of a URI option prefixed with CamelDocker as shown below
| URI Option | Header Property |
|---|---|
containerId | CamelDockerContainerId |
The following example consumes events from Docker:
from("docker://events?host=192.168.59.103&port=2375").to("log:event");The following example queries Docker for system wide information
from("docker://info?host=192.168.59.103&port=2375").to("log:info");To use Docker in your Camel routes you need to add a dependency on camel-docker, which implements the component.
If you use Maven you can just add the following to your pom.xml, substituting the version number for the latest and greatest release (see the download page for the latest versions).
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-docker</artifactId> <version>x.x.x</version> </dependency>