File
Blob: images/container-client-test/BUILD.bazel
| 1 | load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_image_layer") |
| 2 | load("@npm//:defs.bzl", "npm_link_all_packages") |
| 3 | load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load") |
| 4 | |
| 5 | npm_link_all_packages(name = "node_modules") |
| 6 | |
| 7 | js_binary( |
| 8 | name = "app", |
| 9 | data = [":node_modules/ws"], |
| 10 | entry_point = "app.js", |
| 11 | ) |
| 12 | |
| 13 | js_image_layer( |
| 14 | name = "layers", |
| 15 | binary = ":app", |
| 16 | root = "/", |
| 17 | ) |
| 18 | |
| 19 | oci_image( |
| 20 | name = "image", |
| 21 | base = "@node_25_slim", |
| 22 | cmd = ["/{}/app".format(package_name())], |
| 23 | tags = [ |
| 24 | "no-remote", |
| 25 | "requires-container-engine", |
| 26 | ], |
| 27 | target_compatible_with = [ |
| 28 | "@platforms//os:linux", |
| 29 | ], |
| 30 | tars = [ |
| 31 | ":layers", |
| 32 | ], |
| 33 | workdir = "/{}/app.runfiles/_main".format(package_name()), |
| 34 | ) |
| 35 | |
| 36 | oci_load( |
| 37 | name = "load", |
| 38 | image = ":image", |
| 39 | repo_tags = ["cloudflare/workerd/container-client-test:latest"], |
| 40 | visibility = ["//visibility:public"], |
| 41 | ) |
| 42 | |
| 43 | oci_load( |
| 44 | name = "load-proxy-everything", |
| 45 | image = "@proxy_everything", |
| 46 | repo_tags = ["cloudflare/proxy-everything:main"], |
| 47 | visibility = ["//visibility:public"], |
| 48 | ) |