Skip to content

Connection test not successful when using Docker socket #28

@DecaTec

Description

@DecaTec

Local installation on the same machine where Nextcloud is also running.

Command to run the Docker container:

docker run -e NC_HAPROXY_PASSWORD="some_secure_password" \
  -v /var/run/docker.sock:/var/run/docker.sock \
  --name nextcloud-appapi-dsp -h nextcloud-appapi-dsp \
  --restart unless-stopped --privileged -d ghcr.io/cloud-py-api/nextcloud-appapi-dsp:release

These are the information while registering the Deploy Daemon:
image

I would have expected that under "Daemon host", /var/run/docker.sock should be the correct option (as indicated by the text below the input field).

Testing the connection then fails.

Error message in the NC log:

"Could not connect to Docker daemon", ... ,"exception":{"Exception":"Guzzle
Http\\Exception\\ConnectException","Message":"cURL error 7: Failed to connect to localhost port 80 after 0 ms: Couldn't connect to server (see 
https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost/v1.41/_ping" ...

So it tries to connect to localhost instead of using the Docker socket.


My workaround for now is using an additional parameter (-p) when starting the container in order to map the local port to the container's port:

docker run -e NC_HAPROXY_PASSWORD="some_secure_password" \
  -p 127.0.0.1:2375:2375 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  --name nextcloud-appapi-dsp -h nextcloud-appapi-dsp \
  --restart unless-stopped --privileged -d ghcr.io/cloud-py-api/nextcloud-appapi-dsp:release

When adding a Deploy Daemon, under "Daemon host" I've set localhost:2375 and the connection test was successful.

So my questions now are:

  • Should I be able to connect via /var/run/docker.sock
  • Is adding the parameter -p the correct way to deal with this problem?
  • Is this just missing in the documentation or am I missing something?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions