Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
module(name = "io_bazel_rules_docker")

CONTAINERREGISTRY_RELEASE = "v0.0.38"

RULES_DOCKER_GO_BINARY_RELEASE = "aad94363e63d31d574cf701df484b3e8b868a96a"

http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

bazel_dep(name = "platforms", version = "1.0.0")

# Note: rules_cc 0.2.12+ introduces cc_compatibility_proxy which causes
# "cycles detected during computation of main repo mapping" errors with Bazel 8.4.2
# Keep at 0.2.11 until compatibility issue is resolved
# https://github.com/bazelbuild/bazel/issues/27582
bazel_dep(name = "rules_cc", version = "0.2.11")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "rules_go", version = "0.57.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_nodejs", version = "6.7.3")
bazel_dep(name = "rules_pkg", version = "1.1.0")
bazel_dep(name = "rules_scala", version = "7.1.5", repo_name = "io_bazel_rules_scala")

# Main deps
http_file(
name = "go_puller_linux_amd64",
executable = True,
sha256 = "08b8963cce9234f57055bafc7cadd1624cdce3c5990048cea1df453d7d288bc6",
urls = [("https://storage.googleapis.com/rules_docker/" + RULES_DOCKER_GO_BINARY_RELEASE + "/puller-linux-amd64")],
)

http_file(
name = "go_puller_linux_arm64",
executable = True,
sha256 = "912ee7c469b3e4bf15ba5d1f0ee500e7ec6724518862703fa8b09e4d58ce3ee6",
urls = [("https://storage.googleapis.com/rules_docker/" + RULES_DOCKER_GO_BINARY_RELEASE + "/puller-linux-arm64")],
)

http_file(
name = "go_puller_linux_s390x",
executable = True,
sha256 = "a5527b7b3b4a266e4680a4ad8939429665d4173f26b35d5d317385134369e438",
urls = [("https://storage.googleapis.com/rules_docker/" + RULES_DOCKER_GO_BINARY_RELEASE + "/puller-linux-s390x")],
)

http_file(
name = "go_puller_darwin",
executable = True,
sha256 = "4855c4f5927f8fb0f885510ab3e2a166d5fa7cde765fbe9aec97dc6b2761bb22",
urls = [("https://storage.googleapis.com/rules_docker/" + RULES_DOCKER_GO_BINARY_RELEASE + "/puller-darwin-amd64")],
)

http_file(
name = "loader_linux_arm64",
executable = True,
sha256 = "a80966d17b25dbc9313e9fc1cae74ded5916fa64dba0d33438c8adad338b44d3",
urls = [("https://storage.googleapis.com/rules_docker/" + RULES_DOCKER_GO_BINARY_RELEASE + "/loader-linux-arm64")],
)

http_file(
name = "loader_linux_s390x",
executable = True,
sha256 = "0c0ebc3e0a502542547a38b51f4686a049897eeb4cbc0e2f07fc25276c57866f",
urls = [("https://storage.googleapis.com/rules_docker/" + RULES_DOCKER_GO_BINARY_RELEASE + "/loader-linux-s390x")],
)

http_file(
name = "loader_darwin",
executable = True,
sha256 = "8c9986b2b506febbff737090d9ec485cec1376c52789747573521a85194341c1",
urls = [("https://storage.googleapis.com/rules_docker/" + RULES_DOCKER_GO_BINARY_RELEASE + "/loader-darwin-amd64")],
)

http_archive(
name = "containerregistry",
sha256 = "a0c01fcc11db848212f8b11d89df168361f99a31eb7373ff60ce50c5d05cd74b",
strip_prefix = "containerregistry-" + CONTAINERREGISTRY_RELEASE[1:],
urls = [("https://github.com/google/containerregistry/archive/" +
CONTAINERREGISTRY_RELEASE + ".tar.gz")],
)

# For packaging python tools.
http_archive(
name = "subpar",
sha256 = "481233d60c547e0902d381cd4fb85b63168130379600f330821475ad234d9336",
# Commit from 2019-03-07.
strip_prefix = "subpar-9fae6b63cfeace2e0fb93c9c1ebdc28d3991b16f",
urls = ["https://github.com/google/subpar/archive/9fae6b63cfeace2e0fb93c9c1ebdc28d3991b16f.tar.gz"],
)

http_file(
name = "structure_test_linux",
executable = True,
sha256 = "9ddc0791491dc8139af5af4d894e48db4eeaca4b2cb9196293efd615bdb79122",
urls = ["https://storage.googleapis.com/container-structure-test/v1.9.1/container-structure-test-linux-amd64"],
)

http_file(
name = "structure_test_linux_aarch64",
executable = True,
sha256 = "b8fd54ed5f3fcb65861dec8aea5ccf05856c9e030a67461e601eab64c1fe70b1",
urls = ["https://storage.googleapis.com/container-structure-test/v1.9.1/container-structure-test-linux-arm64"],
)

http_file(
name = "structure_test_darwin",
executable = True,
sha256 = "0b8c019b5a3df1a84515b75c2eb47aaf9db51dec621a39d1c4fa31a4a8f6c855",
urls = ["https://storage.googleapis.com/container-structure-test/v1.9.1/container-structure-test-darwin-amd64"],
)

http_file(
name = "container_diff",
executable = True,
sha256 = "65b10a92ca1eb575037c012c6ab24ae6fe4a913ed86b38048781b17d7cf8021b",
urls = ["https://storage.googleapis.com/container-diff/v0.15.0/container-diff-linux-amd64"],
)

register_toolchains(
# Register the default docker toolchain that expects the 'docker'
# executable to be in the PATH
"@io_bazel_rules_docker//toolchains/docker:default_linux_toolchain",
"@io_bazel_rules_docker//toolchains/docker:default_windows_toolchain",
"@io_bazel_rules_docker//toolchains/docker:default_osx_toolchain",
)

docker = use_extension("//:extension.bzl", "docker")

# Automatically configure the docker toolchain rule to use the default
# docker binary from the system path
docker.docker_toolchain_configure(repo_name = "docker_config")
use_repo(docker, "docker_config")

bazel_dep(name = "gazelle", version = "0.45.0", repo_name = "bazel_gazelle")

# Go repositories
go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//container/go:go.mod")
use_repo(go_deps, "com_github_google_go_containerregistry", "com_github_kylelemons_godebug", "com_github_pkg_errors")

bazel_dep(name = "rules_python", version = "1.6.3")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "io_bazel_rules_docker_pip_deps",
python_version = "3.11",
requirements_lock = "@io_bazel_rules_docker//repositories:requirements-pip.txt",
)
Comment on lines +150 to +155
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need a use_repo call?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't seem so, but can't hurt.

use_repo(pip, "io_bazel_rules_docker_pip_deps")
Loading