Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"--mode server" argument erroneously starts controller mode #665

Open
DHowett opened this issue Sep 28, 2024 · 0 comments
Open

"--mode server" argument erroneously starts controller mode #665

DHowett opened this issue Sep 28, 2024 · 0 comments

Comments

@DHowett
Copy link

DHowett commented Sep 28, 2024

I'm trying to set up caddy-docker-proxy in somewhat of an unorthodox way (similar to #616), but I've encountered a disparity between the docs and observed behavior.

The README states,

Server instances doesn't need access to Docker host socket and you can run it in manager or worker nodes.

However, when I run caddy docker-proxy --docker-sockets tcp://this-is-not-a-real-url-and-should-not-exist:1000 --mode server, it fails because it tries to connect to the docker daemon.

2024/09/28 22:30:40.299 INFO    docker-proxy    Running caddy proxy controller
2024/09/28 22:30:40.304 ERROR   docker-proxy    Docker ping failed on specify socket    {"error": "error during connect: Head \"http://this-is-not-a-real-url-and-should-not-exist:1000/_ping\": dial tcp: lookup this-is-not-a-real-url-and-should-not-exist on 10.128.1.253:53: server misbehaving", "DockerSocket": "tcp://this-is-not-a-real-url-and-should-not-exist:1000"}
Error: error during connect: Head "http://this-is-not-a-real-url-and-should-not-exist:1000/_ping": dial tcp: lookup this-is-not-a-real-url-and-should-not-exist on 10.128.1.253:53: server misbehaving

I've tracked it down to the spurious "Running caddy proxy controller".

CADDY_DOCKER_MODE=server caddy docker-proxy works properly.

I suspect it is due to mode being declared as a bool flag here:

fs.Bool("mode", false,
"Which mode this instance should run: standalone | controller | server")

and used as a string flag here:

modeFlag := flags.String("mode")

@DHowett DHowett changed the title "--mode server" argument seems to erroneouslyt start controller mode "--mode server" argument erroneously starts controller mode Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant