osrf / rocker

A tool to run docker containers with overlays and convenient options for things like GUIs etc.
Apache License 2.0
532 stars 68 forks source link

SSH agent forwarding during build #246

Open agyoungs opened 9 months ago

agyoungs commented 9 months ago

It would be nice if there was a way to forward the ssh agent during the build so you could perform actions like cloning repos in the Dockerfile. Unfortunately, this is a limitation of docker-py (see https://github.com/docker/docker-py/issues/3178). Is there a workaround for Rocker?

tfoote commented 9 months ago

I don't have a workaround for this. There's a fundamental challenge that the builds are supposed to be reproducible. If you're leveraging content from outside the workspace, such as an ssh agent that goes against that philosophy. Which I think is why it's referenced in docker-py ticket as more of a docker engine limitation, that's potentially partially intentional. I'd be happy to integrate the capability from upstream but I don't think that it makes sense to try to force a way around it here. rocker's focus is on dynamically extending builds and improving the runtime experience. Overriding the core build capabilities is stretching the scope more than I would generally want to do.