是可能的绑定目录到容器,而使用 Camel apache?我尝试像:
from("kafka:xxx-xxx?brokers=localhost:9092")
.setProperty("xxx", simple(procVers()))
.setHeader(DockerConstants.DOCKER_REPOSITORY, simple("xxx"))
.setHeader(DockerConstants.DOCKER_TAG, simple("xxx"))
.setHeader(DockerConstants.DOCKER_IMAGE_ID, simple("xxx"))
.setHeader(DockerConstants.DOCKER_IMAGE, simple("xxx:xxx"))
.setHeader(DockerConstants.DOCKER_NAME, exchangeProperty("xxx"))
.setHeader(DockerConstants.DOCKER_ENV, () -> new String []{
"MODE=xxx", "PARSER_CLIENT=xxx",
"PATHS=/home/xxx/xxx" })
.setHeader(DockerConstants.DOCKER_BINDS,simple("/xxx/:/xxx/"))
.setHeader(DockerConstants.DOCKER_CONTAINER_ID, simple("${body.id}"))
.to("docker:containerstart?host=/var/run/docker.sock")
.log("container started")
.setHeader(DockerConstants.DOCKER_CONTAINER_ID, simple("${body.id}"))
.to("docker:containerwait?host=/var/run/docker.sock?")
.log("container end");
但不工作,运行时不会出错。
1条答案
按热度按时间kqlmhetl1#
如果有人不想等到下一个camel版本,我找到了解决方法。您必须在DOCKER_HOST_CONFIG中添加HostConfig示例。示例: