Giter Site home page Giter Site logo

Comments (8)

mattmoor avatar mattmoor commented on May 23, 2024

docker_push supports make-style expansion for the components:

vardef("MY_TAG", "latest")

docker_push(
    name = "foo_push",
    image = ":foo_image",
    registry = "gcr.io",
    repository = "foo/bar/baz",
    tag = "$(MY_TAG)",
)

Or is that not what you want?

from rules_docker.

mattmoor avatar mattmoor commented on May 23, 2024

@damienmg How can I access this in skylark?

from rules_docker.

mattmoor avatar mattmoor commented on May 23, 2024

Ok, blocked by: bazelbuild/bazel#1054

from rules_docker.

ixdy avatar ixdy commented on May 23, 2024

Similar / clarifying request: I'd like to be able to tag an image automatically using the git sha of the workspace. We use --workspace_status_command to set this for go rules, but there's currently no way to use that in docker rules.

Make-style expansion isn't ideal, since that requires adding --defines to the bazel command line.

from rules_docker.

mattmoor avatar mattmoor commented on May 23, 2024

In other places we allow @foo to load the value from a file. I wonder if this would be sufficient for your purposes?

from rules_docker.

ixdy avatar ixdy commented on May 23, 2024

That might work. I implemented a hack (ixdy/bazel@3b29803) to do that a few months ago, and it's what the kubernetes bazel build is currently using, though it still feels pretty hacky

(I got preoccupied with other things and didn't follow up on some review feedback, and now things have moved around a bit so I'd need to rebase my change.)

The go rules got around waiting for Skylark support (bazelbuild/bazel#1054) by implementing stamping through reading the ctx.info_file and ctx.version_file directly.

Since IIRC most of the actual docker image/layer-building implementation happens in python, I wonder if we could do something similar and have the info/version files passed through to the scripts on stamp=1?
I haven't thought through all of the implications yet, or if the rules will work correctly with unexpanded variables in skylark.

from rules_docker.

mikedanese avatar mikedanese commented on May 23, 2024

Is this fixed?

from rules_docker.

mattmoor avatar mattmoor commented on May 23, 2024

docker_push doesn't support it, but docker_bundle does.

from rules_docker.

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.