Releases: bazel-contrib/rules_oci
v1.3.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.3.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 = "a3b6f4c0051938940ccf251a7bdcdf7ac5a93ae00e63ad107c9c6d3bfe20885b",
strip_prefix = "rules_oci-1.3.1",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.3.1/rules_oci-v1.3.1.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "LATEST_ZOT_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: smoke test includes a pull by @alexeagle in #332
- fix(bzlmod): print working MODULE.bazel reproducibility instructions by @alexeagle in #317
- fix(oci_image): restore tars=foo.tar.gz by @alexeagle in #335
Full Changelog: v1.3.0...v1.3.1
v1.3.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.3.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 = "910926b6add3cf9dba74ccd52cc22791406aa00de751b1e552ee2b74967cde68",
strip_prefix = "rules_oci-1.3.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.3.0/rules_oci-v1.3.0.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "LATEST_ZOT_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,
)
What's Changed
- Update release.yml by @alexeagle in #296
- fix: oci_tarball should support more than 2 repo_tags by @sfc-gh-ptabor in #300
- feat(windows): introduce batch wrapper by @alexeagle in #305
- fix(windows): account for \r\n line endings by @alexeagle in #304
- fix(windows): check in empty tar file rather than create dynamically by @alexeagle in #303
- fix(windows): use bazel-lib helper to read HOME env var by @alexeagle in #308
- fix(windows): prevent path transformation of arguments to crane mutate by @alexeagle in #306
- Ignore empty repo-tags in the file. Allow \n at the end of files. by @sfc-gh-ptabor in #312
- fix: restrict oci_image#tar attribute to .tar files by @alexeagle in #313
- fix: allow passwords that contain : by @tokongs in #314
- docs: improve bzlmod install instructions by @alexeagle in #316
New Contributors
Full Changelog: v1.2.0...v1.3.0
v1.2.0
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "176e601d21d1151efd88b6b027a24e782493c5d623d8c6211c7767f306d655c8",
strip_prefix = "rules_oci-1.2.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.2.0/rules_oci-v1.2.0.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "LATEST_ZOT_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,
)
What's Changed
- feat: #180 make the tarball target runnable by @ewhauser in #290
- Add example for how to create a static content server image with nginx. by @echochamber in #255
- Make sure that the
tars
list contains unique records by @uhlajs in #256 - Add support for HTTP Basic auth by @joca-bt in #268
- Allow to supply env to oci_image as a file (e.g. stamped). by @sfc-gh-ptabor in #264
- Fix failing //oci/tests:test_chainguard_static test on ARM. by @sfc-gh-ptabor in #263
- Replace shasum with sha256sum by @aaliddell in #277
- Update Crane version by @uhlajs in #281
- Replace --fail-with-body for a test that checks the status code by @jamiees2 in #276
- Fix: Error: key "type" not found in dictionary by @prestonvanloon in #291
- Remove '"' from path in MANIFEST_DIGEST when creating a tar file by @rbielak in #278
- fix: Avoid mkdir -p attempting to change permissions by @anguslees in #271
- Fix typo in oci_push docs by @Sovietaced in #274
- fix(docs): indicate that oci_tarball#repo_tags is mandatory by @alexeagle in #293
New Contributors
- @echochamber made their first contribution in #255
- @uhlajs made their first contribution in #256
- @joca-bt made their first contribution in #268
- @sfc-gh-ptabor made their first contribution in #264
- @aaliddell made their first contribution in #277
- @jamiees2 made their first contribution in #276
- @prestonvanloon made their first contribution in #291
- @rbielak made their first contribution in #278
- @anguslees made their first contribution in #271
- @Sovietaced made their first contribution in #274
- @ewhauser made their first contribution in #290
Full Changelog: v1.0.0...v1.2.0
v1.1.0
🙈
This release was tagged one commit sooner than intended, so we recommend you jump to v1.2.0 instead.
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "63d12d31a59cfe7e93d42b2b86f3d737e73c3b6ce79a205192e0c4c5e8a3cf6d",
strip_prefix = "rules_oci-1.1.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.1.0/rules_oci-v1.1.0.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "LATEST_ZOT_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,
)
What's Changed
Full Changelog: v1.0.0...v1.1.0
v1.0.0
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "db57efd706f01eb3ce771468366baa1614b5b25f4cce99757e2b8d942155b8ec",
strip_prefix = "rules_oci-1.0.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.0.0/rules_oci-v1.0.0.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "LATEST_ZOT_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,
)
What's Changed
- chore: remove registry flag now that container-structure-test is on BCR by @alexeagle in #223
- refactor: rename oci_push#repotags to default_tags by @thesayyn in #222
- chore: rename repotags to repo_tags by @alexeagle in #224
- refactor: replace print statements with warning by @thesayyn in #226
- fix: single image with tag is handled incorrectly by @thesayyn in #231
- add latest cosign releases by @bobcallaway in #232
- chore: remove bzlmod workaround by @alexeagle in #227
- fix: implement per registry credential helpers by @tstromberg in #237
- test: add test for per registry credential helpers by @thesayyn in #242
- docs: add load site by @alexeagle in #243
- Add auth support for cgr.dev (Chainguard Images) by @tstromberg in #246
- feat: show a .tar.xz image layer from debian by @alexeagle in #250
New Contributors
- @bobcallaway made their first contribution in #232
- @tstromberg made their first contribution in #237
Full Changelog: v0.6.2...v1.0.0
v1.0.0-rc1
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "7824dcb6c9f9f87786d65592da006d9f1e2bea826d7560d96745e54cdecb5d47",
strip_prefix = "rules_oci-1.0.0-rc1",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.0.0-rc1/rules_oci-v1.0.0-rc1.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "LATEST_ZOT_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,
)
What's Changed
- refactor: replace print statements with warning by @thesayyn in #226
- fix: single image with tag is handled incorrectly by @thesayyn in #231
- add latest cosign releases by @bobcallaway in #232
- chore: remove bzlmod workaround by @alexeagle in #227
- fix: implement per registry credential helpers by @tstromberg in #237
- test: add test for per registry credential helpers by @thesayyn in #242
- docs: add load site by @alexeagle in #243
New Contributors
- @bobcallaway made their first contribution in #232
- @tstromberg made their first contribution in #237
Full Changelog: v1.0.0-rc0...v1.0.0-rc1
v1.0.0-rc0
📰 This release is the first to offer a semver-stability guarantee, since we've graduated from a 0.x version.
There will be bug-fixes leading up to the final 1.0.0 release, but no breaking changes or new features.
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "08d73a9bec22642ee12c0a38c23596cbddaba7422eede74edba3bb1044d579be",
strip_prefix = "rules_oci-1.0.0-rc0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v1.0.0-rc0/rules_oci-v1.0.0-rc0.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "LATEST_ZOT_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,
)
What's Changed
- chore: remove registry flag now that container-structure-test is on BCR by @alexeagle in #223
- refactor: rename oci_push#repotags to remote_tags by @thesayyn in #222
- chore: rename repotags to repo_tags by @alexeagle in #224
Full Changelog: v0.6.2...v1.0.0-rc0
v0.6.2
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "ee13d5d1a4548ecc6c3498474dd1c467f5ac46cf8ccfbb361f94c6a333b27b89",
strip_prefix = "rules_oci-0.6.2",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v0.6.2/rules_oci-v0.6.2.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "LATEST_ZOT_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,
)
What's Changed
- fix: CI shouldn't skip the root folder for bzlmod by @alexeagle in #219
Full Changelog: v0.6.1...v0.6.2
v0.6.1
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "856cdddbe32b8cc8e4a76bdffce1aa6f54642f6a7f54e4d06868af8874e80e9d",
strip_prefix = "rules_oci-0.6.1",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v0.6.1/rules_oci-v0.6.1.tar.gz",
)
load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies")
rules_oci_dependencies()
load("@rules_oci//oci:repositories.bzl", "LATEST_CRANE_VERSION", "LATEST_ZOT_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,
)
What's Changed
- chore: fix BCR release by using a patch on container-structure-test by @alexeagle in #218
Full Changelog: v0.6.0...v0.6.1
v0.6.0
WORKSPACE snippet:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_oci",
sha256 = "8aa36ae6c8067ff5a837ecb05aeb6396e5a469194b14bf98ff2ddf956ae817ec",
strip_prefix = "rules_oci-0.6.0",
url = "https://github.com/bazel-contrib/rules_oci/releases/download/v0.6.0/rules_oci-v0.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", "LATEST_ZOT_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,
)
What's Changed
- fix: downgrade rules_pkg to 0.7.0 by @thesayyn in #195
- ci: disable macos ci by @thesayyn in #194
- docs: be more clear that you load a tarball target by @alexeagle in #197
- fix: remove duplicate debian target by @thesayyn in #192
- ci: remove upterm action by @thesayyn in #201
- fix: pinning is broken by @thesayyn in #200
- chore: remove structure test by @alexeagle in #182
- docs: add build instruction for rust by @vucong2409 in #173
- fix: take variant into account by @thesayyn in #174
- chore: re-use release automation workflow by @alexeagle in #204
- chore: test on Bazel 6 and Bazel 5 by @alexeagle in #203
- fix: disallow os, arch and variant to be specified with base by @thesayyn in #172
- Fix bug with formatting of repotags in tarball manifest.json [re-do] by @AttilaTheFun in #205
- refactor: make pinning a warning by @thesayyn in #206
- fix: extract image digest raw from yq by @steeve in #208
- Revert "fix: extract image digest raw from yq" by @thesayyn in #210
- Revert "refactor: merge repository into repotags (#169)" by @alexeagle in #213
- test: add missing test case for oci_tarball#repotags by @thesayyn in #209
- fix: port number should be allowed in push by @thesayyn in #215
- refactor: drop rules_pkg dependency by @thesayyn in #207
- test: assert oci_* rules are reproducible by @thesayyn in #214
New Contributors
- @vucong2409 made their first contribution in #173
- @AttilaTheFun made their first contribution in #205
- @steeve made their first contribution in #208
Full Changelog: v0.5.0...v0.6.0