harness / gitness

Gitness is an Open Source developer platform with Source Control management, Continuous Integration and Continuous Delivery.
https://gitness.com
Apache License 2.0
31.96k stars 2.79k forks source link

Set the docker enpoint (TCP) #3446

Closed indaco closed 6 months ago

indaco commented 6 months ago

Best practices for docker encourage to avoid accessing the Docker API without any restriction (aka /var/run/docker.sock)

Possible solutions are expose the Docker socket over TCP or SSH. For TCP exposing I use the TecnativaDocker Socket Proxy. This approach requires to connect the docker client to that socket exposed as e.g.tcp://docker-socket-proxy:2375

E.g.

How to achieve that with gitness? I tried:

Any advice? Thanks

bradrydzewski commented 6 months ago

You can pass the DOCKER_HOST variable to Gitness to override the host address

DOCKER_HOST=tcp://localhost:2375

Note that DOCKER_CERT_PATH, DOCKER_TLS_VERIFY and DOCKER_API_VERSION are also supported.

indaco commented 6 months ago

Thanks a lot @bradrydzewski. It works.

For future references...

set POST=1 on docker-socket-proxy config in addition to other settings