Giter Club home page Giter Club logo

Comments (3)

ash2k avatar ash2k commented on June 3, 2024

Hey, thanks for suggestion. I new about these extra rules but I haven't tried them. I have just tried and here is what I found:

  • it is cool that I don't need to maintain distroless base layer sha
  • Gazelle still generates go_binary rule and if go_image has name=smith then they conflict.
  • If I change name=smith_container on go_image to avoid the conflict then it works but now I have two rules - just like before :)
  • I need an ability to run the binary. I usually build it and then run it (I don't use bazel run for this). This becomes bazel-bin/cmd/smith/smith_container.binary vs bazel-bin/cmd/smith/smith. It's a bit uglier and, which is more important, more magical - it is not obvious what is that .binary and there is no way to know it exists without looking at the rule implementation.

So given the above I think it is unlikely I'll use it unless there is a way to improve the user experience somehow.

from smith.

mattmoor avatar mattmoor commented on June 3, 2024

Yeah, I have a bug open against Gazelle. This came up here so I may augment the surface of language rules that don't benefit from layering to also accept the binary target directly.

(to elaborate a bit) For Go there is less benefit than with languages like Python and Java where we can intelligently factor layers (you can see some commentary on this here and here). Eventually I'd like to make this more intelligent and less manual.

I'll open an FR on rules_docker to track this for now.

it is cool that I don't need to maintain distroless base layer sha

Even if you don't use go_image, you can get the benefit of this by using the following symbol for your base image: https://github.com/bazelbuild/rules_docker/blob/master/go/image.bzl#L59-L64 This has the benefit of putting busybox into containers built with -c dbg :)

Mostly I wanted to reach out and make sure you were aware of the option. If you run into any problems, please don't hesitate to reach out.

from smith.

mattmoor avatar mattmoor commented on June 3, 2024

I think this should get you what you want.

Let me know if you run into any trouble using it.

from smith.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.