From 3f160cc4ae16185bada920fb0a46f23e315f5572 Mon Sep 17 00:00:00 2001 From: Marcin Grabda Date: Sun, 18 May 2025 09:02:35 -0500 Subject: [PATCH] Enhancement: support specifying protocol for Docker Socket Proxy (#5285) Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> --- docs/configs/docker.md | 13 +++++++++++++ src/utils/config/docker.js | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/docs/configs/docker.md b/docs/configs/docker.md index 992897cb6..c228f72e3 100644 --- a/docs/configs/docker.md +++ b/docs/configs/docker.md @@ -66,6 +66,19 @@ my-docker: port: 2375 ``` +Use `protocol: https` if you’re connecting through a reverse proxy (e.g., Traefik) that serves the Docker API over HTTPS: + +```yaml +my-docker: + host: dockerproxy + port: 443 + protocol: https +``` + +!!! note + + Note: This does not require TLS certificates if the proxy handles encryption. Do not use `protocol: https` unless you’re sure the target host supports HTTPS. + ## Using Socket Directly If you'd rather use the socket directly, first make sure that you're passing the local socket into the Docker container. diff --git a/src/utils/config/docker.js b/src/utils/config/docker.js index f56faae08..5dcef4da0 100644 --- a/src/utils/config/docker.js +++ b/src/utils/config/docker.js @@ -43,6 +43,10 @@ export default function getDockerArguments(server) { res.conn.protocol = "https"; } + if (servers[server].protocol) { + res.conn.protocol = servers[server].protocol; + } + return res; }