osrf / rocker

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

[feature] Support 1) passing Dockerfile, 2) passing .repos file (vcstool etal) to allow building Docker img using sources from multiple repos #135

Open 130s opened 3 years ago

130s commented 3 years ago

Problem

I only recently found osrf/rocker, and immediately became a fan. Looks like it is capable of running docker build internally but I can't find interface for users/operators. AFAICT, without an interface to accept those things, you'd only be able to run the prebuilt Docker image (if you need to run a custom Docker img, you'd have to build by yourself).

Question

Is osrf/rocker intended to be NOT a tool to build your custom Docker image? If so, this request is likely invalid.

Relevant work

B/c building a custom Docker image using upstream repos is such a high demand (at least for me), I rencently started 130s/docker_vcstool (very inmature ATM), which essentially wraps docker build with accomodating a custom Dockerfile and build the sources taken from the passed .repos. If there's a room for osrf/rocker to add such a feature to build based on custom input sources, I can contribute a PR.

Particularly I'd appreciate your input @tfoote @ruffsl.

tfoote commented 3 years ago

This is currently out of scope for rocker. It was designed as "running docker" and a way to improve invoking docker run .... ... ... lots of arguments ... ... as well as doing things that need to be done at runtime in the image that cannot be shared.

The goal is that you can have shared prebuilt docker images that are easily shared via existing mechanisms. And then rocker lets you customize it for your local use case. (aka inject nvidia, mount things as your user, or otherwise leverage content from your user space which isn't baked into the image and may change run to run etc) The docker build things you see internally is using multi-stage builds to add layers to the images to inject content into the images (such as the nvidia drivers).

If you have something that's currently in your local workspace you can relatively easily invoke it like this

docker build -t my_image .
rocker --some-args my_image

What capability do you feel rocker could add to the build process?