이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 37. Docker


Docker Component

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.
Maven users will need to add the following dependency to their pom.xml for this component:
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-docker</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>
Copy to Clipboard Toggle word wrap

URI format

docker://[operation]?[options]
Copy to Clipboard Toggle word wrap
Where operation is the specific action to perform on Docker.

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
Expand
URI Option Header Property
containerId CamelDockerContainerId

General Options

The following parameters can be used with any invocation of the component
Expand
Option Header Description Default Value
host CamelDockerHost Mandatory: Docker host localhost
port CamelDockerPort Mandatory:Docker port 2375
username CamelDockerUserName User name to authenticate with
password CamelDockerPassword Password to authenticate with
email CamelDockerEmail Email address associated with the user
secure CamelDockerSecure Use HTTPS communication false
requestTimeout CamelDockerRequestTimeout Request timeout for response (in seconds) 30
certPath CamelDockerCertPath Location containing the SSL certificate chain

Consumer Operations

The consumer supports the following operations.
Expand
Operation Options Description Produces
events initialRange Monitor Docker events (Streaming) Event

Producer Operations

The following producer operations are available.
Expand
Misc Operation Options Description Returns
auth Check auth configuration
info System wide information Info
ping Ping the Docker server
version Show the docker version information Version
Expand
Image Operation Options Description Body Content Returns
image/list filter, showAll List images List<Image>
image/create repository Create an image InputStream CreateImageResponse
image/build noCache, quiet, remove, tag Build an image from Dockerfile via stdin InputStream or File InputStream
image/pull repository, registry, tag Pull an image from the registry InputStream
image/push name Push an image on the registry InputStream
image/search term Search for images List<SearchItem>
image/remove imageId Remove an image
image/tag imageId, repository, tag, force Tag an image into a repository
image/inspect imageId Inspect an image InspectImageResponse
Expand
Container Operation Options Description Body Content Returns
container/list showSize, showAll, before, since, limit, List containers initialRange List<Container>
container/create imageId, name, exposedPorts, workingDir, disableNetwork, hostname, user, tty, stdInOpen, stdInOnce, memoryLimit, memorySwap, cpuShares, attachStdIn, attachStdOut, attachStdErr, env, cmd, dns, image, volumes, volumesFrom Create a container CreateContainerResponse
container/start
containerId, binds, links, lxcConf, portBindings, privileged, publishAllPorts, dns, dnsSearch, volumesFrom, networkMode, devices, restartPolicy, capAdd, capDrop
Start a container
container/inspect containerId Inspect a container InspectContainerResponse
container/wait containerId Wait a container Integer
container/log containerId, stdOut, stdErr, timestamps, followStream, tailAll, tail Get container logs InputStream
container/attach containerId, stdOut, stdErr, timestamps, logs, followStream Attach to a container InputStream
container/stop containerId, timeout Stop a container
container/restart containerId, timeout Restart a container
container/diff containerId Inspect changes on a container ChangeLog
container/kill containerId, signal Kill a container
container/top containerId, psArgs List processes running in a container TopContainerResponse
container/pause containerId Pause a container
container/unpause containerId Unpause a container
container/commit containerId, repository, message, tag, attachStdIn, attachStdOut, attachStdErr, cmd, disableNetwork, pause, env, exposedPorts, hostname, memory, memorySwap, openStdIn, portSpecs, stdInOnce, tty, user, volumes, hostname Create a new image from a container's changes String
container/copyfile containerId, resource, hostPath Copy files or folders from a container InputStream
container/remove containerId, force, removeVolumes Remove a container

Examples

The following example consumes events from Docker:
from("docker://events?host=192.168.59.103&port=2375").to("log:event");
Copy to Clipboard Toggle word wrap
The following example queries Docker for system wide information
from("docker://info?host=192.168.59.103&port=2375").to("log:info");
Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat