= Docker Component
:doctitle: Docker
:shortname: docker
:artifactid: camel-docker
:description: Manage Docker containers.
:since: 2.15
:supportlevel: Stable
:component-header: Both producer and consumer are supported
//Manually maintained attributes
:camel-spring-boot-name: docker

*Since Camel {since}*

*{component-header}*

Camel component for communicating with Docker.

The Docker Camel component leverages the
https://github.com/docker-java/docker-java[docker-java] via the
https://docs.docker.com/reference/api/docker_remote_api[Docker Remote
API].


== URI format

------------------------------
docker://[operation]?[options]
------------------------------

Where *operation* is the specific action to perform on Docker.

// component-configure options: START

// component-configure options: END

// component options: START
include::partial$component-configure-options.adoc[]
include::partial$component-endpoint-options.adoc[]
// component options: END

// endpoint options: START

// endpoint options: END


== Header Strategy

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

[width="100%",cols="50%,50%",options="header",]
|=======================================================================
|URI Option |Header Property

|containerId |CamelDockerContainerId
|=======================================================================


== Examples

The following example consumes events from Docker:

[source,java]
----------------------------------------------------------------------
from("docker://events?host=192.168.59.103&port=2375").to("log:event");
----------------------------------------------------------------------

The following example queries Docker for system wide information

[source,java]
-------------------------------------------------------------------
from("docker://info?host=192.168.59.103&port=2375").to("log:info");
-------------------------------------------------------------------


== Dependencies

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).

[source,xml]
-------------------------------------
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-docker</artifactId>
  <version>x.x.x</version>
</dependency>
-------------------------------------


include::spring-boot:partial$starter.adoc[]
