Comments (7)
In addition to tags, there should be support for stamping labels (and possibly other fields).
from rules_oci.
What do you think about stamping / label support for the repository
attribute of oci_push
?
The use case I have in mind is enabling developers to test out a container image in their private container registry (think ghcr.io/<user>/foo
) via a build setting but also having a default setting for releases (like company.tld/foo
).
I can also move this into a separate issue if that's preferred.
This is how rules_docker
does it: https://github.com/bazelbuild/rules_docker/blob/6db7c12fbe4b49682f5dcbc193e4c467011a9fb6/container/push.bzl#L52-L55
from rules_oci.
Thanks! Getting the company involved may take some time. I'll discuss it internally.
Donating privately may be an option. What I can offer is helping out with maintenance and feature development in some capacity.
from rules_oci.
@thesayyn I have a new idea to approach this that doesn't require we run more actions, and maybe it also satisfies your desire to have a file passed in.
# instead of default_tags: ["latest"] we have a new metadata attribute:
oci_push(
name = "push_image",
metadata = {"default_tags": ["latest"]},
image = ":image",
repository = "index.docker.io/<ORG>/image",
)
metadata
could later include custom labels as well.
oci_push
becomes a macro so that dict
value is supported, like we do for inline tsconfig.json
:
def oci_push(name, metadata = None, **kwargs):
if types.is_dict(metadata):
metadata_label = "_{}_write_metadata".format(name)
write_file(
name = metadata_label,
out = "_{}.json".format(name),
content = [json.encode(metadata)],
)
metadata = metadata_label
oci_push_rule(
name = name,
metadata = metadata,
**kwargs
)
so the attribute on the oci_push
rule is a label pointing to a JSON file.
Now the user can use the existing affordance for stamping in our jq
rule:
jq(
name = "stamped_metadata",
srcs = [],
filter = "|".join([
"$ARGS.named.STAMP as $stamp",
# With --stamp, use the --embed_label value, otherwise use 0.0.0
""".default_tags = [($stamp.BUILD_EMBED_LABEL // "0.0.0")]""",
]),
)
oci_push(
name = "push_image_index",
metadata = ":stamped_metadata",
image = ":image_index",
repository = "index.docker.io/<ORG>/image",
)
WDYT?
from rules_oci.
I updated #70 with a partly-working implementation for this proposal
from rules_oci.
I love this. it's almost what I tried to describe to you in our call. like the idea that stamping is done in a separate action and fed as a file to the rule.
from rules_oci.
Yeah that's #46
BTW, if your company can help out here (aside from your feedback and issues) take a look at our sponsor button above :)
from rules_oci.
Related Issues (20)
- getting "/app does not exist" error when trying to run image created with oci_image HOT 3
- FR: support automatically passing digest to the underlying oci_pull under bzlmod
- Authentication fail on some private registry HOT 3
- Reintroduce container_run_and_extract? HOT 1
- C++ docker example fails due to missing GLIBCXX_3.4.32
- oci_image fails on Windows with "%1 is not a valid Win32 application"
- Drop curl fallback for oci_pull HOT 1
- oci_push fails on Windows with "%1 is not a valid Win32 application"
- Tar symlinks cannot find layer from external repository HOT 6
- setuptools have a file named 'launcher manifest.xml' which have space in the filename. This fail the image build cause of tar not support such things. HOT 1
- Adding bazel tag support to oci_pull (import_tags) because an oci_pull for a large image does not work when run on remote execution HOT 2
- Bug: aspect_bazel_lib dependency is leaking into users module
- FR: Teach Renovate or provide tooling around updating oci.pull hashes in MODULE.bazel HOT 1
- oci_tarball doesn't handle base images HOT 2
- FR: Use hermetic docker-credential-helpers for auth HOT 2
- Use storage instead of memory for registry HOT 1
- Bug: "invalid path" with rules_oci 2.0.0-alpha0
- How to use build container in bazel? HOT 2
- Is it possible to build a python web image in more flexable way which will following some python docker best practice. HOT 5
- `2.0.0-alpha1` installation instructions broken for `MODULE.bazel` HOT 2
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_oci.