Skip to content

Commit

Permalink
make pulling images a bit more modular
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrikSD committed Dec 5, 2024
1 parent ce49412 commit c28f231
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 81 deletions.
75 changes: 2 additions & 73 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ bazel_dep(name = "rules_jvm_external", version = "6.2")
bazel_dep(name = "contrib_rules_jvm", version = "0.27.0")
bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_oci", version = "2.0.1")

include("//infra/containers:containers.MODULE.bazel")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")

# Version variables
# renovate: datasource=maven depName=com.google.inject:guice-bom
Expand Down Expand Up @@ -96,74 +96,3 @@ maven.install(

use_repo(maven, "maven")

oci.pull(
name = "nginx",
image = "docker.io/library/nginx",
digest = "sha256:28402db69fec7c17e179ea87882667f1e054391138f77ffaf0c3eb388efc3ffb",
platforms = [
"linux/386",
"linux/amd64",
"linux/arm/v5",
"linux/arm/v7",
"linux/arm64/v8",
"linux/mips64le",
"linux/ppc64le",
"linux/s390x"
]
)

oci.pull(
name = "registry",
image = "docker.io/library/registry",
digest = "sha256:ac0192b549007e22998eb74e8d8488dcfe70f1489520c3b144a6047ac5efbe90",
platforms = [
"linux/amd64",
"linux/arm/v6",
"linux/arm/v7",
"linux/arm64/v8",
"linux/ppc64le",
"linux/s390x",
]
)

oci.pull(
name = "distroless",
image = "gcr.io/distroless/static",
digest = "sha256:cc226ca14d17d01d4b278d9489da930a0dd11150df10ae95829d13e6d00fbdbf",
platforms = [
"linux/amd64",
"linux/arm/v7",
"linux/arm64/v8",
"linux/s390x",
"linux/ppc64le",
]
)

use_repo(
oci,
"distroless",
"distroless_linux_amd64",
"distroless_linux_arm_v7",
"distroless_linux_arm64_v8",
"distroless_linux_s390x",
"distroless_linux_ppc64le",

"nginx",
"nginx_linux_386",
"nginx_linux_amd64",
"nginx_linux_arm_v5",
"nginx_linux_arm_v7",
"nginx_linux_arm64_v8",
"nginx_linux_mips64le",
"nginx_linux_ppc64le",
"nginx_linux_s390x",

"registry",
"registry_linux_amd64",
"registry_linux_arm_v6",
"registry_linux_arm_v7",
"registry_linux_arm64_v8",
"registry_linux_ppc64le",
"registry_linux_s390x",
)

16 changes: 8 additions & 8 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added infra/containers/BUILD
Empty file.
8 changes: 8 additions & 0 deletions infra/containers/containers.MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bazel_dep(name = "rules_oci", version = "2.0.1")

oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")

include("//infra/containers/distroless:distroless.MODULE.bazel")
include("//infra/containers/nginx:nginx.MODULE.bazel")
include("//infra/containers/registry:registry.MODULE.bazel")

Empty file.
25 changes: 25 additions & 0 deletions infra/containers/distroless/distroless.MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")

oci.pull(
name = "distroless",
image = "gcr.io/distroless/static",
digest = "sha256:cc226ca14d17d01d4b278d9489da930a0dd11150df10ae95829d13e6d00fbdbf",
platforms = [
"linux/amd64",
"linux/arm/v7",
"linux/arm64/v8",
"linux/s390x",
"linux/ppc64le",
]
)

use_repo(
oci,
"distroless",
"distroless_linux_amd64",
"distroless_linux_arm_v7",
"distroless_linux_arm64_v8",
"distroless_linux_s390x",
"distroless_linux_ppc64le",
)

Empty file added infra/containers/nginx/BUILD
Empty file.
32 changes: 32 additions & 0 deletions infra/containers/nginx/nginx.MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")

oci.pull(
name = "nginx",
image = "docker.io/library/nginx",
digest = "sha256:28402db69fec7c17e179ea87882667f1e054391138f77ffaf0c3eb388efc3ffb",
platforms = [
"linux/386",
"linux/amd64",
"linux/arm/v5",
"linux/arm/v7",
"linux/arm64/v8",
"linux/mips64le",
"linux/ppc64le",
"linux/s390x"
]
)


use_repo(
oci,
"nginx",
"nginx_linux_386",
"nginx_linux_amd64",
"nginx_linux_arm_v5",
"nginx_linux_arm_v7",
"nginx_linux_arm64_v8",
"nginx_linux_mips64le",
"nginx_linux_ppc64le",
"nginx_linux_s390x",
)

28 changes: 28 additions & 0 deletions infra/containers/registry/registry.MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")

oci.pull(
name = "registry",
image = "docker.io/library/registry",
digest = "sha256:ac0192b549007e22998eb74e8d8488dcfe70f1489520c3b144a6047ac5efbe90",
platforms = [
"linux/amd64",
"linux/arm/v6",
"linux/arm/v7",
"linux/arm64/v8",
"linux/ppc64le",
"linux/s390x",
]
)


use_repo(
oci,
"registry",
"registry_linux_amd64",
"registry_linux_arm_v6",
"registry_linux_arm_v7",
"registry_linux_arm64_v8",
"registry_linux_ppc64le",
"registry_linux_s390x",
)

0 comments on commit c28f231

Please sign in to comment.