fix: default to not mounting docker socket in exec #1090
No reviewers
Labels
No labels
FreeBSD
Kind/Breaking
Kind/Bug
Kind/Chore
Kind/DependencyUpdate
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Windows
linux-powerpc64le
linux-riscv64
linux-s390x
run-end-to-end-tests
run-forgejo-tests
run-multi-platform-tests
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
forgejo/runner!1090
Loading…
Reference in a new issue
No description provided.
Delete branch "drewcassidy/runner:fix-dont-mount-socket"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1073
forgejo-runner execcurrently defaults to mounting/var/run/docker.sockin the job container, which might not exist. This PR changes the default to not mounting anything in the job container. This mirrors the default value of thedocker_hostconfig valueIf mounting a docker socket in the job container is desired, the user can use
--container-daemon-socketlooks like some of the tests were written with the assumption that when
ContainerDaemonSocketis set to an empty string it should mount/var/run/docker.sock. Not sure if I should update the tests or put the code I pulled fromact/runnerback. personally I think the default should always be not to mount anything but understand this could be a breaking change for some.I'm not so sure of this, since it's a breaking change for users who access
exectoday and may have existing workflows around it. What would you think of detecting the absence of/var/run/docker.sockand proceeding with this behaviour only in that case, maybe with an info-level log message?its not just about it existing, but also about it being accessible to the current user. the docker socket is only usable by users in the docker group by default. Thats what I was running into when I filed the issue (I said it didn't exist, I later realized it did exist thanks to the Podman-docker shim I installed because the docs told me to, even though I was using the podman user socket. I just didn't have write access to it)
Manually running workflows that themselves deal with docker doesnt seem like it would be a super common use case, but it is possible. maybe this could be delayed to a more major update when breaking changes are more palatable?
Hm, I develop almost all my workflows with
forgejo-runner execbecause it's a faster dev cycle, including those that build containers, but I don't do that daily. I could counter-argue that usingforgejo-runner execon a system without access to the docker socket doesn't seem like a super common use case. I think we'd both be right that neither case is common. 😉Thinking back to making it automatic -- rather than checking if the socket exists, could we make an attempt to access the socket? I believe there's a
Pingmethod on the docker client Go API...View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.