Add docker image building rules
Signed-off-by: James Munnelly <james@munnelly.eu>
This commit is contained in:
parent
b1f145625e
commit
64f02f6004
18
BUILD.bazel
18
BUILD.bazel
@ -1,3 +1,21 @@
|
||||
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle")
|
||||
load("@io_bazel_rules_docker//contrib:push-all.bzl", "docker_push")
|
||||
|
||||
container_bundle(
|
||||
name = "images",
|
||||
images = {
|
||||
"{STABLE_DOCKER_REPO}/cert-manager-controller:{STABLE_DOCKER_TAG}": "//cmd/controller:image",
|
||||
"{STABLE_DOCKER_REPO}/cert-manager-acmesolver:{STABLE_DOCKER_TAG}": "//cmd/acmesolver:image",
|
||||
"{STABLE_DOCKER_REPO}/cert-manager-webhook:{STABLE_DOCKER_TAG}": "//cmd/webhook:image",
|
||||
},
|
||||
stamp = True,
|
||||
)
|
||||
|
||||
docker_push(
|
||||
name = "images.push",
|
||||
bundle = ":images",
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(
|
||||
|
||||
@ -1,5 +1,16 @@
|
||||
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_image(
|
||||
name = "image",
|
||||
base = "@alpine//image",
|
||||
embed = [":go_default_library"],
|
||||
goarch = "amd64",
|
||||
goos = "linux",
|
||||
pure = "on",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["main.go"],
|
||||
|
||||
@ -1,5 +1,16 @@
|
||||
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_image(
|
||||
name = "image",
|
||||
base = "@alpine//image",
|
||||
embed = [":go_default_library"],
|
||||
goarch = "amd64",
|
||||
goos = "linux",
|
||||
pure = "on",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
|
||||
@ -1,5 +1,16 @@
|
||||
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_image(
|
||||
name = "image",
|
||||
base = "@alpine//image",
|
||||
embed = [":go_default_library"],
|
||||
goarch = "amd64",
|
||||
goos = "linux",
|
||||
pure = "on",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["main.go"],
|
||||
|
||||
@ -37,6 +37,8 @@ fi
|
||||
|
||||
# TODO: properly configure this file
|
||||
cat <<EOF
|
||||
STABLE_DOCKER_REPO ${DOCKER_REPO:-quay.io/jetstack}
|
||||
STABLE_DOCKER_TAG ${DOCKER_TAG:-$APP_VERSION}
|
||||
STABLE_APP_GIT_COMMIT ${APP_GIT_COMMIT}
|
||||
STABLE_APP_GIT_STATE ${GIT_STATE}
|
||||
STABLE_APP_VERSION ${APP_VERSION}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user