Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cool Project ! #3

Open
ramtej opened this issue Jul 10, 2017 · 6 comments
Open

Cool Project ! #3

ramtej opened this issue Jul 10, 2017 · 6 comments

Comments

@ramtej
Copy link

ramtej commented Jul 10, 2017

Hi,
this is a really nice project - thank you !

One idea regarding dependency management - do you know the GoogleCloudPlatform/distroless ?
They define rules to specify dependencies:

dpkg(
name = "libc6",
source = "@debian_jessie//file:Packages.json",
)

Evtl. you can make use of it.

One question - is the "container_image" compatible with the
https://github.com/bazelbuild/rules_docker approach?

e.g.

docker_build(
    name = "app",
    # References docker_pull from WORKSPACE (above)
    base = "@java_base//image", # HERE a container_image() referrence ??
    files = ["//java/com/example/app:Hello_deploy.jar"],
    cmd = ["Hello_deploy.jar"]
)

Best Regards,
jj

@guymers
Copy link
Owner

guymers commented Jul 11, 2017

I wasn't aware of distroless, looks like a nice way of getting Debian dependencies. Having to build Docker containers and then scrapping apt-cache is a bit hacky and doesn't work well if other people want to use these images. I will look into it more.

I actually had a quick look at rules_docker on the weekend, seems to have had a lot of activity in the last month. I don't think container_image would be compatible directly, it exists because there isn't a 1-1 mapping between images and layers. container_image contains the image metadata and a list of layers built by container_layer. You could build the .tar, but I would like to see if I can get compatibility or maybe just move back to docker_build.

@ramtej
Copy link
Author

ramtej commented Jul 11, 2017

ok, the approach done by distroless is elegant so I think it would make sense to follow the approach. At the other side, the containers_by_bazel is a unique catalog of "apps" that can be used directly by bazel, together with things like versioning, dependency management.

.. and finally, it would be really great to "bake" layered docker images.

Do you need some help? Can I contribute somehow?

Best Regards,
jj

@guymers
Copy link
Owner

guymers commented Jul 11, 2017

Sure! You could try incorporating distroless into this repo if you want.

I am currently using the apt-cache method mainly to have it find all the dependencies of a package. Looking at distroless it seems like dpkg only downloads a single deb file. Also wondering if it would be worth using http://snapshot.debian.org/ like how the Debian Docker image does. The most annoying thing at the moment is package versions increasing and old ones being removed from Debian mirrors. Then you have to build the dependency containers again and run the apt-cache script.

Building containers with Bazel is so much better than using Dockerfiles, glad to see someone else interested!

@ramtej
Copy link
Author

ramtej commented Jul 12, 2017

Ok, I will take a look on the distroless approach, to see how/if can be added to your repository.
Indeed, the Bazel way to build docker images is pretty elegant. At the other side, Bazel is a bit of "diva", means things can sometimes be surprisingly difficult !

Regards,
jj

@guymers
Copy link
Owner

guymers commented Jul 16, 2017

I have updated container_image so it can now use docker_build output as a base image and can also be used as input to other docker_* rules.

@ramtej
Copy link
Author

ramtej commented Jul 17, 2017

thx - I will take a look on it !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants