cloud/bmaas/server/cmd: add container_image
Change-Id: Iead21d276a81f01f72fc554ea6b5dec43137c883
Reviewed-on: https://review.monogon.dev/c/monogon/+/1501
Reviewed-by: Serge Bazanski <serge@monogon.tech>
Tested-by: Jenkins CI
diff --git a/cloud/BUILD.bazel b/cloud/BUILD.bazel
index f9fbd9a..ca52bf3 100644
--- a/cloud/BUILD.bazel
+++ b/cloud/BUILD.bazel
@@ -6,6 +6,7 @@
images = {
"gcr.io/monogon-infra/cloud/apigw:{IMAGE_TAG}": "//cloud/apigw:apigw_container",
"gcr.io/monogon-infra/cloud/shepherd/equinix:{IMAGE_TAG}": "//cloud/shepherd/equinix/manager/server:server_container",
+ "gcr.io/monogon-infra/cloud/bmsrv:{IMAGE_TAG}": "//cloud/bmaas/server/cmd:cmd_container",
},
)
diff --git a/cloud/bmaas/server/cmd/BUILD.bazel b/cloud/bmaas/server/cmd/BUILD.bazel
index dc43afc..0977a44 100644
--- a/cloud/bmaas/server/cmd/BUILD.bazel
+++ b/cloud/bmaas/server/cmd/BUILD.bazel
@@ -1,4 +1,6 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+load("@io_bazel_rules_docker//container:container.bzl", "container_image")
+load("//build/static_binary_tarball:def.bzl", "static_binary_tarball")
go_library(
name = "cmd_lib",
@@ -13,3 +15,17 @@
embed = [":cmd_lib"],
visibility = ["//visibility:public"],
)
+
+static_binary_tarball(
+ name = "cmd_layer",
+ executable = ":cmd",
+)
+
+container_image(
+ name = "cmd_container",
+ base = "@go_image_base//image",
+ entrypoint = ["/app/cloud/bmaas/server/cmd/cmd_/cmd"],
+ tars = [":cmd_layer"],
+ visibility = ["//visibility:public"],
+ workdir = "/app",
+)