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

Ability to set custom path to Docker socket #757

Closed
3 tasks done
9p4 opened this issue Feb 7, 2022 · 2 comments · Fixed by #763
Closed
3 tasks done

Ability to set custom path to Docker socket #757

9p4 opened this issue Feb 7, 2022 · 2 comments · Fixed by #763

Comments

@9p4
Copy link
Contributor

9p4 commented Feb 7, 2022

Clear and concise description of the problem

Set an environment variable to have the Docker client connect to a specific socket. This would enable people to use Podman as their runner (using the Docker compatibility socket). Currently, I have /var/run/docker.socket symlinked to the user's Podman socket /run/user/1000/podman.sock, but this is an inelegant solution at best.

Suggested solution

Add an environment variable (maybe WOODPECKER_DOCKER_SOCKET) that, if set, can set the addr value in the Docker client (https://github.com/moby/moby/blob/88bd93fa603870897400b7d1f0c836d554caf85e/client/client.go#L73)

Alternative

A dedicated Podman runner, but that would be much more difficult to use than using the Podman compatibility layer.

Additional context

#85

Validations

@mscherer
Copy link
Contributor

mscherer commented Feb 8, 2022

From a quick look at the code, you can set DOCKER_HOST and the underlying client library will do the right thing.

The only issue is that https://github.com/woodpecker-ci/woodpecker/blob/master/pipeline/backend/docker/docker.go#L39 hardcode the path.

@wxiaoguang
Copy link

I bypass this problem by setting:

    environment:
      - DOCKER_HOST=unix:///data-dind/dockerd/docker.sock
      - WOODPECKER_BACKEND=docker

mscherer added a commit to mscherer/woodpecker that referenced this issue Feb 8, 2022
@6543 6543 closed this as completed in #763 Feb 8, 2022
6543 pushed a commit that referenced this issue Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants