Releases: bazel-contrib/rules_oci
v2.0.0-alpha2
Using bzlmod with Bazel 6 or later:
-
Add
common --enable_bzlmod
to.bazelrc
. -
Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_oci", version = "2.0.0-alpha2")
# For testing, we also recommend https://registry.bazel.build/modules/container_structure_test
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# Declare external images you need to pull, for example:
oci.pull(
name = "distroless_base",
# 'latest' is not reproducible, but it's convenient.
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
# values which you can use here in place of 'tag' to pin for reproducibility.
tag = "latest",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64"],
)
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
use_repo(oci, "distroless_base")
Using WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "e96d70faa4bace3e09fdb1d7d1441b838920f491588889ff9a7e2615afca5799",
strip_prefix = "rules_oci-2.0.0-alpha2",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v2.0.0-alpha2/rules_oci-v2.0.0-alpha2.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "oci_register_toolchains")
oci_register_toolchains(name = "oci")
# You can pull your base images using oci_pull like this:
load("@rules_oci//oci:pull.bzl", "oci_pull")
oci_pull(
name = "distroless_base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64",
],
)
What's Changed
- example: add dockerfile build by @thesayyn in #570
- refactor: remove curl fallback by @thesayyn in #568
- Use non-blocking download to get image blobs, on Bazel >=7.1.0 by @mortenmj in #601
- fix: add tars into action inputs by @thesayyn in #599
- chore: disable dockerfile example by @thesayyn in #605
Full Changelog: v2.0.0-alpha1...v2.0.0-alpha2
v1.7.6
Using bzlmod with Bazel 6 or later:
-
Add
common --enable_bzlmod
to.bazelrc
. -
Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_oci", version = "1.7.6")
# For testing, we also recommend https://registry.bazel.build/modules/container_structure_test
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# Declare external images you need to pull, for example:
oci.pull(
name = "distroless_base",
# 'latest' is not reproducible, but it's convenient.
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
# values which you can use here in place of 'tag' to pin for reproducibility.
tag = "latest",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64"],
)
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
use_repo(oci, "distroless_base")
Using WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "647f4c6fd092dc7a86a7f79892d4b1b7f1de288bdb4829ca38f74fd430fcd2fe",
strip_prefix = "rules_oci-1.7.6",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.7.6/rules_oci-v1.7.6.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "oci_register_toolchains")
oci_register_toolchains(
name = "oci",
crane_version = LATEST_CRANE_VERSION,
# Uncommenting the zot toolchain will cause it to be used instead of crane for some tasks.
# Note that it does not support docker-format images.
# zot_version = LATEST_ZOT_VERSION,
)
# You can pull your base images using oci_pull like this:
load("@rules_oci//oci:pull.bzl", "oci_pull")
oci_pull(
name = "distroless_base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64",
],
)
What's Changed
- docs: simplify use of expand_template by @alexeagle in #534
- chore: upgrade rules_go and gazelle by @thesayyn in #541
- ci: only test with bazel 6, 7 by @thesayyn in #533
- Add a minimal c++ example in doc by @rygx in #516
- [docs] Add missing name to push examples by @ptxmac in #513
- feat: add nvcr.io to _WWW_AUTH by @nobu-k in #511
- fix: Add quay back to authn config by @ankit-agarwal1999 in #543
- docs: recommend rules_distroless by @thesayyn in #546
- Fix #552 and update readme by @chokychou in #554
- Reduce GHA caching by @alexeagle in #557
- Fix oci_image failing with "%1 is not a valid Win32 application" by @bartoszpop in #556
- chore: update aspect url by @gregmagolan in #561
- chore: don't cancel concurrent main builds by @gregmagolan in #563
- oci_push to support Windows builds by @bartoszpop in #565
- Quotes removal from MEDIA_TYPE string. by @kczulko in #577
- Return extension_metadata from oci.pull() by @mortenmj in #580
- fix: don't include xattr by @alexeagle in #579
- feat: Allow setting both tag and digest in oci_pull when reproducible is True by @mark-thm in #587
- fix: fix race condition in oci_pull where bazel can write platform manifest contents to the cache entry for image index manifest by @gregmagolan in #596
New Contributors
- @rygx made their first contribution in #516
- @ptxmac made their first contribution in #513
- @nobu-k made their first contribution in #511
- @ankit-agarwal1999 made their first contribution in #543
- @chokychou made their first contribution in #554
- @bartoszpop made their first contribution in #556
- @kczulko made their first contribution in #577
- @mark-thm made their first contribution in #587
Full Changelog: v1.7.5...v1.7.6
v2.0.0-alpha1
BREAKING CHANGES
- Uncompressed archives in the tars attribute is no longer compressed when creating the image, this might make images bigger compared to 1.x. Use pkg_tar#compression or tar#compress attribute to compress the layers beforehand.
- Digests of images created 1.x rules_oci will not match 2.x rules_oci, as we are no longer using crane to create the images. However, images should stay the same semantically.
- Default output of
oci_tarball
is no longer a tarball, use afilegroup
target to get the tarball. See #548 - Bazel 5 is no longer supported.
CHANGES
- OCIImage action no longer spins an ephemeral registry instance to mutate images locally, making it slightly faster.
- oci_image now supports zstd compression
Using bzlmod with Bazel 6 or later:
-
Add
common --enable_bzlmod
to.bazelrc
. -
Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_oci", version = "2.0.0-alpha1")
# For testing, we also recommend https://registry.bazel.build/modules/container_structure_test
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# Declare external images you need to pull, for example:
oci.pull(
name = "distroless_base",
# 'latest' is not reproducible, but it's convenient.
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
# values which you can use here in place of 'tag' to pin for reproducibility.
tag = "latest",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64"],
)
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
use_repo(oci, "distroless_base")
Using WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "0d8c189119f175cc51e69e26e0cf75a493716bce7de9f03c77d67ea8cc8ec5db",
strip_prefix = "rules_oci-2.0.0-alpha1",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v2.0.0-alpha1/rules_oci-v2.0.0-alpha1.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "oci_register_toolchains")
oci_register_toolchains(name = "oci")
# You can pull your base images using oci_pull like this:
load("@rules_oci//oci:pull.bzl", "oci_pull")
oci_pull(
name = "distroless_base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64",
],
)
What's Changed
- docs: simplify use of expand_template by @alexeagle in #534
- chore: upgrade rules_go and gazelle by @thesayyn in #541
- ci: only test with bazel 6, 7 by @thesayyn in #533
- Add a minimal c++ example in doc by @rygx in #516
- [docs] Add missing name to push examples by @ptxmac in #513
- feat: add nvcr.io to _WWW_AUTH by @nobu-k in #511
- fix: Add quay back to authn config by @ankit-agarwal1999 in #543
- docs: recommend rules_distroless by @thesayyn in #546
- refactor: remove yq dependency by @thesayyn in #386
- refactor: use hermetic tar by @alexeagle in #385
- Add
toolchain
param to the affected actions by @kotlaja in #341 - Pass headers to Bazel downloader where available by @mortenmj in #528
- feat: don't produce big tar file as default output of oci_tarball by @alexeagle in #548
- refactor: remove registry references by @thesayyn in #551
- chore: update deps and bazel by @thesayyn in #553
- refactor: registryless oci_image by @thesayyn in #550
- feat: implement out-of-band descriptor calculation by @thesayyn in #558
- feat: implement tars symlinks by @thesayyn in #559
- feat: support symlinking blobs from base by @thesayyn in #560
- fix: make oci_image fully hermetic by @thesayyn in #569
- fix: canonicalize missing components by @thesayyn in #567
- fix: duplicate tar copying by @thesayyn in #576
- Add jq as dependency required for oci_push by @mering in #589
New Contributors
- @rygx made their first contribution in #516
- @ptxmac made their first contribution in #513
- @nobu-k made their first contribution in #511
- @ankit-agarwal1999 made their first contribution in #543
- @kotlaja made their first contribution in #341
- @mering made their first contribution in #589
Full Changelog: v1.7.5...v2.0.0-alpha1
v1.7.5
Using bzlmod with Bazel 6 or later:
-
Add
common --enable_bzlmod
to.bazelrc
. -
Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_oci", version = "1.7.5")
# For testing, we also recommend https://registry.bazel.build/modules/container_structure_test
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# Declare external images you need to pull, for example:
oci.pull(
name = "distroless_base",
# 'latest' is not reproducible, but it's convenient.
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
# values which you can use here in place of 'tag' to pin for reproducibility.
tag = "latest",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64"],
)
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
use_repo(oci, "distroless_base")
Using WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "56d5499025d67a6b86b2e6ebae5232c72104ae682b5a21287770bd3bf0661abf",
strip_prefix = "rules_oci-1.7.5",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.7.5/rules_oci-v1.7.5.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "oci_register_toolchains")
oci_register_toolchains(
name = "oci",
crane_version = LATEST_CRANE_VERSION,
# Uncommenting the zot toolchain will cause it to be used instead of crane for some tasks.
# Note that it does not support docker-format images.
# zot_version = LATEST_ZOT_VERSION,
)
# You can pull your base images using oci_pull like this:
load("@rules_oci//oci:pull.bzl", "oci_pull")
oci_pull(
name = "distroless_base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64",
],
)
What's Changed
- image: allow .tar.zst extension on layer tar by @alexeagle in #523
- chore: remove examples/ from published artifact by @alexeagle in #524
- chore: remove dead code due to duplication by @alexeagle in #522
- Support inheriting environment variable that's value contains = by @sfc-gh-mhazy in #526
- Revert "feat: use link instead of copy for blobs in oci_image_index" by @thesayyn in #525
- Revert "image: allow .tar.zst extension on layer tar" by @alexeagle in #532
- Add cosign v2.2.3 by @loosebazooka in #536
New Contributors
- @sfc-gh-mhazy made their first contribution in #526
- @loosebazooka made their first contribution in #536
Full Changelog: v1.7.4...v1.7.5
v1.7.4
Using bzlmod with Bazel 6 or later:
-
Add
common --enable_bzlmod
to.bazelrc
. -
Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_oci", version = "1.7.4")
# For testing, we also recommend https://registry.bazel.build/modules/container_structure_test
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# Declare external images you need to pull, for example:
oci.pull(
name = "distroless_base",
# 'latest' is not reproducible, but it's convenient.
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
# values which you can use here in place of 'tag' to pin for reproducibility.
tag = "latest",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64"],
)
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
use_repo(oci, "distroless_base")
Using WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "4a276e9566c03491649eef63f27c2816cc222f41ccdebd97d2c5159e84917c3b",
strip_prefix = "rules_oci-1.7.4",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.7.4/rules_oci-v1.7.4.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "oci_register_toolchains")
oci_register_toolchains(
name = "oci",
crane_version = LATEST_CRANE_VERSION,
# Uncommenting the zot toolchain will cause it to be used instead of crane for some tasks.
# Note that it does not support docker-format images.
# zot_version = LATEST_ZOT_VERSION,
)
# You can pull your base images using oci_pull like this:
load("@rules_oci//oci:pull.bzl", "oci_pull")
oci_pull(
name = "distroless_base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64",
],
)
What's Changed
Full Changelog: v1.7.3...v1.7.4
v1.7.3
Using bzlmod with Bazel 6 or later:
-
Add
common --enable_bzlmod
to.bazelrc
. -
Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_oci", version = "1.7.3")
# For testing, we also recommend https://registry.bazel.build/modules/container_structure_test
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# Declare external images you need to pull, for example:
oci.pull(
name = "distroless_base",
# 'latest' is not reproducible, but it's convenient.
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
# values which you can use here in place of 'tag' to pin for reproducibility.
tag = "latest",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64"],
)
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
use_repo(oci, "distroless_base")
Using WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "1026da778d5ecf25052fff289dbe84b1703324f0186eae09aa61a2d73b7440fe",
strip_prefix = "rules_oci-1.7.3",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.7.3/rules_oci-v1.7.3.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "oci_register_toolchains")
oci_register_toolchains(
name = "oci",
crane_version = LATEST_CRANE_VERSION,
# Uncommenting the zot toolchain will cause it to be used instead of crane for some tasks.
# Note that it does not support docker-format images.
# zot_version = LATEST_ZOT_VERSION,
)
# You can pull your base images using oci_pull like this:
load("@rules_oci//oci:pull.bzl", "oci_pull")
oci_pull(
name = "distroless_base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64",
],
)
What's Changed
- chore: add bazel matrix by @alexeagle in #500
- Update python.md by @alexeagle in #504
- example: add a big image example by @thesayyn in #507
- Always allow specifying the "platforms" attribute in
oci_pull
by @sitaktif in #474 - fix: remove curl cache by @thesayyn in #515
- fix: fix util.sha256 error code handling by @gregmagolan in #518
- fix: don't use rctx symlink for manifest.json by @gregmagolan in #517
Full Changelog: v1.7.2...v1.7.3
v1.7.2
Using bzlmod with Bazel 6 or later:
-
Add
common --enable_bzlmod
to.bazelrc
. -
Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_oci", version = "1.7.2")
# For testing, we also recommend https://registry.bazel.build/modules/container_structure_test
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# Declare external images you need to pull, for example:
oci.pull(
name = "distroless_base",
# 'latest' is not reproducible, but it's convenient.
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
# values which you can use here in place of 'tag' to pin for reproducibility.
tag = "latest",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64"],
)
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
use_repo(oci, "distroless_base")
Using WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "cf6b8be82cde30daef18a09519d75269650317e40d917c8633cf8e3ab5645ea5",
strip_prefix = "rules_oci-1.7.2",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.7.2/rules_oci-v1.7.2.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "oci_register_toolchains")
oci_register_toolchains(
name = "oci",
crane_version = LATEST_CRANE_VERSION,
# Uncommenting the zot toolchain will cause it to be used instead of crane for some tasks.
# Note that it does not support docker-format images.
# zot_version = LATEST_ZOT_VERSION,
)
# You can pull your base images using oci_pull like this:
load("@rules_oci//oci:pull.bzl", "oci_pull")
oci_pull(
name = "distroless_base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64",
],
)
What's Changed
- Remove pid file for deterministic build by @BoleynSu in #489
- refactor: bring back config attribute by @thesayyn in #494
- Revert "fix: improve error reporting" by @alexeagle in #499
New Contributors
Full Changelog: v1.7.1...v1.7.2
v1.7.1
Using bzlmod with Bazel 6 or later:
-
Add
common --enable_bzlmod
to.bazelrc
. -
Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_oci", version = "1.7.1")
# For testing, we also recommend https://registry.bazel.build/modules/container_structure_test
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# Declare external images you need to pull, for example:
oci.pull(
name = "distroless_base",
# 'latest' is not reproducible, but it's convenient.
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
# values which you can use here in place of 'tag' to pin for reproducibility.
tag = "latest",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64"],
)
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
use_repo(oci, "distroless_base")
Using WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "e611971cddbd355f0bc09d5e4b07e5029da44b5ce061b327179f7d3b1c46767e",
strip_prefix = "rules_oci-1.7.1",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.7.1/rules_oci-v1.7.1.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "oci_register_toolchains")
oci_register_toolchains(
name = "oci",
crane_version = LATEST_CRANE_VERSION,
# Uncommenting the zot toolchain will cause it to be used instead of crane for some tasks.
# Note that it does not support docker-format images.
# zot_version = LATEST_ZOT_VERSION,
)
# You can pull your base images using oci_pull like this:
load("@rules_oci//oci:pull.bzl", "oci_pull")
oci_pull(
name = "distroless_base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64",
],
)
What's Changed
- Fix config_path not passed through in oci_pull macro by @jacktigerzhang in #488
- chore: repository cleanup by @gregmagolan in #495
- fix: improve error reporting by @thesayyn in #490
- fix: blob directory is wrong by @thesayyn in #498
Full Changelog: v1.7.0...v1.7.1
v1.7.0
Using bzlmod with Bazel 6 or later:
-
Add
common --enable_bzlmod
to.bazelrc
. -
Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_oci", version = "1.7.0")
# For testing, we also recommend https://registry.bazel.build/modules/container_structure_test
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# Declare external images you need to pull, for example:
oci.pull(
name = "distroless_base",
# 'latest' is not reproducible, but it's convenient.
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
# values which you can use here in place of 'tag' to pin for reproducibility.
tag = "latest",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64"],
)
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
use_repo(oci, "distroless_base")
Using WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "6ae66ccc6261d3d297fef1d830a9bb852ddedd3920bbd131021193ea5cb5af77",
strip_prefix = "rules_oci-1.7.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.7.0/rules_oci-v1.7.0.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "oci_register_toolchains")
oci_register_toolchains(
name = "oci",
crane_version = LATEST_CRANE_VERSION,
# Uncommenting the zot toolchain will cause it to be used instead of crane for some tasks.
# Note that it does not support docker-format images.
# zot_version = LATEST_ZOT_VERSION,
)
# You can pull your base images using oci_pull like this:
load("@rules_oci//oci:pull.bzl", "oci_pull")
oci_pull(
name = "distroless_base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64",
],
)
What's Changed
- chore: example incremental loader by @thesayyn in #455
- docs: clarify rules_docker replacement belief by @thesayyn in #467
- fix: improve error handling in image.sh.tpl by @sitaktif in #461
- feat: bump and assert crane version 0.18.0 by @aw185176 in #470
- add docker.elastic.co registry support by @cristifalcas in #471
- docs: explain where we look for docker config.json for auth by @alexeagle in #476
- fix: unbound variable error by @SpencerC in #469
- Add quay.io registry support by @jacktigerzhang in #487
- doc: explain --credential_helper by @thesayyn in #485
- docs: comparison to dockerfile by @thesayyn in #486
New Contributors
- @sitaktif made their first contribution in #461
- @aw185176 made their first contribution in #470
- @cristifalcas made their first contribution in #471
- @SpencerC made their first contribution in #469
- @jacktigerzhang made their first contribution in #487
Full Changelog: v1.6.0...v1.7.0
v1.6.0
Using bzlmod with Bazel 6 or later:
-
Add
common --enable_bzlmod
to.bazelrc
. -
Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_oci", version = "1.6.0")
# For testing, we also recommend https://registry.bazel.build/modules/container_structure_test
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# Declare external images you need to pull, for example:
oci.pull(
name = "distroless_base",
# 'latest' is not reproducible, but it's convenient.
# During the build we print a WARNING message that includes recommended 'digest' and 'platforms'
# values which you can use here in place of 'tag' to pin for reproducibility.
tag = "latest",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64"],
)
# For each oci.pull call, repeat the "name" here to expose them as dependencies.
use_repo(oci, "distroless_base")
Using WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "58b7a175ee90c12583afeca388523adf6a4e5a0528f330b41c302b91a4d6fc06",
strip_prefix = "rules_oci-1.6.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.6.0/rules_oci-v1.6.0.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "oci_register_toolchains")
oci_register_toolchains(
name = "oci",
crane_version = LATEST_CRANE_VERSION,
# Uncommenting the zot toolchain will cause it to be used instead of crane for some tasks.
# Note that it does not support docker-format images.
# zot_version = LATEST_ZOT_VERSION,
)
# You can pull your base images using oci_pull like this:
load("@rules_oci//oci:pull.bzl", "oci_pull")
oci_pull(
name = "distroless_base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = [
"linux/amd64",
"linux/arm64",
],
)
What's Changed
- chore: bump minimum bazel-lib by @alexeagle in #449
- fix: listen on loopback address by @thesayyn in #434
- refactor: make e2e/auth bazel test by @thesayyn in #447
- fix: glob blobs directory by @thesayyn in #450
- support passing label as container cli tool to bazel run //my/tarball by @jchorl in #441
- refactor: rename new attribute on oci_tarball by @alexeagle in #453
- perf: make registry output to bazel-out by @thesayyn in #324
New Contributors
Full Changelog: v1.5.1...v1.6.0