docker socket forwarding support
- This PR adds a new mount type: `docker.sock` (in addition to `cache` and `tmp`) - It's then able to mount the LOCAL (as in, from the machine running dagger) docker socket inside the container by pretending to be an SSH Agent (hijacking the SSH agent forwarding support of buildkit) Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
@@ -468,6 +468,11 @@ func (p *Pipeline) mount(ctx context.Context, dest string, mnt *compiler.Value)
|
||||
llb.Scratch(),
|
||||
llb.Tmpfs(),
|
||||
), nil
|
||||
case "docker.sock":
|
||||
return llb.AddSSHSocket(
|
||||
llb.SSHID(solver.DockerSocketID),
|
||||
llb.SSHSocketTarget(dest),
|
||||
), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("invalid mount source: %q", s)
|
||||
}
|
||||
|
Reference in New Issue
Block a user