Croway commented on code in PR #29107:
URL: https://github.com/apache/camel/pull/29107#discussion_r4456928953


##########
components/camel-docker/src/main/java/org/apache/camel/component/docker/DockerConfiguration.java:
##########
@@ -63,7 +63,7 @@ public class DockerConfiguration implements Cloneable {
     private boolean followRedirectFilter;
     @UriParam(label = "security", defaultValue = "false")
     private boolean tlsVerify;
-    @UriParam(label = "advanced", defaultValue = "true")
+    @UriParam(label = "advanced", defaultValue = "false")

Review Comment:
   The effective default was not TCP for every user: Camel Spring Boot applied 
the documented `true`. The starter generates `private Boolean socket = true;`, 
and up to camel-spring-boot 4.22.x the auto-configuration copied every non-null 
option to the component. CAMEL-24501 (4.23.0) stopped copying options the 
application did not set.
   
   A Spring Boot app with only `camel-docker-starter` and no docker properties 
prints:
   
   ```
   camel=4.18.4 component.socket=true  endpoint docker:info socket=true  
host=localhost
   camel=4.22.2 component.socket=true  endpoint docker:info socket=true  
host=localhost
   camel=4.23.0 component.socket=false endpoint docker:info socket=false 
host=localhost
   ```
   
   So a 4.18 or 4.22 Spring Boot app that sets only 
`camel.component.docker.host=/var/run/docker.sock` used the socket without 
setting `socket`. After the upgrade it connects to 
`tcp:///var/run/docker.sock:2375` instead. Could the upgrade guide say that the 
documented default of `socket` is now `false` (its real default), and that a 
Spring Boot application that relied on the socket must set 
`camel.component.docker.socket=true`?



##########
components/camel-docker/src/main/docs/docker-component.adoc:
##########
@@ -35,6 +35,28 @@ include::partial$component-endpoint-headers.adoc[]
 
 == Usage
 
+=== Connecting to the Docker daemon
+
+By default, the component connects over TCP to `host` and `port` 
(`tcp://localhost:2375`). Docker does not open this
+TCP port by default; it has to be enabled in the configuration of the daemon.
+
+To connect to the local unix socket of the daemon instead, set `socket=true`. 
In socket mode `host` is the path of the
+socket and `port` is not used. The default host `localhost` means 
`/var/run/docker.sock`:
+
+[source,java]
+----
+from("timer:info?repeatCount=1")
+    .to("docker:info?socket=true")
+    .log("${body}");
+----
+
+For a socket in another place, set its path as the host, for example
+`docker:info?socket=true&host=/run/user/1000/docker.sock`.
+
+The host can also be a full Docker host URL with a `tcp://`, `unix://` or 
`npipe://` scheme, in the same form as the

Review Comment:
   Neither cmd exec factory of docker-java supports `npipe://`. On the PR head, 
`DockerClientFactory.getDockerClient` with 
`host=npipe:////./pipe/docker_engine` gives:
   
   ```
   NettyDockerCmdExecFactory  -> IllegalArgumentException: Unsupported protocol 
scheme: npipe:////./pipe/docker_engine
   JerseyDockerCmdExecFactory -> IllegalArgumentException: Unsupported protocol 
scheme: npipe:////./pipe/docker_engine
   ```
   
   Failing early is better than the `tcp://npipe:...:2375` of main, but the 
docs (here and in the `host` description) should not list `npipe://` as 
supported.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to