Comments (8)
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.
@damienmg How can I access this in skylark?
from rules_docker.
Ok, blocked by: bazelbuild/bazel#1054
from rules_docker.
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 --define
s to the bazel command line.
from rules_docker.
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.
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.
Is this fixed?
from rules_docker.
docker_push
doesn't support it, but docker_bundle
does.
from rules_docker.
Related Issues (20)
- When sandbox network is disabled rules_docker rules cannot communicate with docker daemon HOT 1
- Multi-Architecture Support for container_run_and_commit HOT 1
- Shelless invocation for container_run_and_commit HOT 1
- Support multiple python versions in py3_image's py_binary HOT 1
- Support image labels/annotations HOT 1
- Default to Bazel target architecture HOT 2
- Bad timezone for Marocco with @go_image_base//image
- Use binary output from go_binary for go_image
- `container_run_and_extract` does not work with Podman HOT 1
- How to properly use dockerfile_image? HOT 4
- How to get the coredump file in container?
- Sporadic failures of `wrong number of hex digits for sha256`
- The `workdir` for `cc_image` is not the runfiles directory by default.
- go_image always builds for linux/amd64 irrespective of host platform
- rules_nodejs and rules_docker conflict
- container_pull failed for images layers with MediaType "application/vnd.docker.image.rootfs.diff.tar"
- portable_mtime for py3_image
- Support Native Bazel Tags for Build Querying
- py3_image: No Matching Toolchains Found
- rules_docker fails to build with HEAD bazel
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_docker.