Will Rouesnel
Will Rouesnel

Reputation: 318

Exposing an entire apt repository as a target for bazel?

I would like to build docker images in Bazel. Our current builds do a fair amount of apt-get'ing to pull in packages and their dependencies inside the docker build. This is not ideal because the build system has no real concept of tracking the actual upstream packages we need.

But - we definitely don't want to be manually trying to resolve and sort out every dependency in a docker image for a deb package either.

Is there a module or method which allows me to bring the equivalent of apt-get install [thing into the build environment that will automatically pull down the packages it depends on as well (so I can then install them into the docker image via the various extract functions)?

The ideal endstate is one where the Bazel dependency tree is tracking upstream packages for me against their respective repositories, and where if multiple docker images depend off the same packages it will correctly detect when they all need to be rebuilt.

Upvotes: 1

Views: 763

Answers (1)

mattmoor
mattmoor

Reputation: 1707

You may want to have a look at the discussion here where we are exploring more or less this exact topic for the purposes of bootstrapping images without the full distro inside.

Upvotes: 3

Related Questions