Skip to content
This repository was archived by the owner on Jun 14, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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
55 changes: 15 additions & 40 deletions docker/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@bazel_tools//tools/build_defs/docker:docker.bzl", "docker_build")
load("//docker:manager_docker.bzl", "manager_docker_build")

# Use "manual" target tag to skip rules in the wildcard expansion

Expand Down Expand Up @@ -47,9 +47,11 @@ pkg_tar(
tags = ["manual"],
)

docker_build(
name = "init",
base = "@docker_ubuntu//:xenial",
manager_docker_build(
images = [
{"name": "init", "base": "@docker_ubuntu//:xenial"},
{"name": "init_debug", "base": "@ubuntu_xenial_debug//file"},
],
entrypoint = ["/usr/local/bin/prepare_proxy.sh"],
repository = "istio",
tags = ["manual"],
Expand All @@ -61,18 +63,11 @@ docker_build(
tars = [":prepare_proxy"],
)

docker_build(
name = "init_debug",
base = "@ubuntu_xenial_debug//file",
entrypoint = ["/usr/local/bin/prepare_proxy.sh"],
repository = "istio",
tags = ["manual"],
tars = [":prepare_proxy"],
)

docker_build(
name = "runtime",
base = "@docker_ubuntu//:xenial",
manager_docker_build(
images = [
{"name": "runtime", "base": "@docker_ubuntu//:xenial"},
{"name": "runtime_debug", "base": "@ubuntu_xenial_debug//file"},
],
entrypoint = ["/usr/local/bin/manager"],
repository = "istio",
tags = ["manual"],
Expand All @@ -83,31 +78,11 @@ docker_build(
],
)

docker_build(
name = "runtime_debug",
base = "@ubuntu_xenial_debug//file",
entrypoint = ["/usr/local/bin/manager"],
repository = "istio",
tags = ["manual"],
tars = [
"@istio_proxy_debug//file",
":manager",
":config",
manager_docker_build(
images = [
{"name": "app", "base": "@docker_ubuntu//:xenial"},
{"name": "app_debug", "base": "@ubuntu_xenial_debug//file"},
],
)

docker_build(
name = "app",
base = "@docker_ubuntu//:xenial",
entrypoint = ["/bin/server"],
repository = "istio",
tags = ["manual"],
tars = [":test"],
)

docker_build(
name = "app_debug",
base = "@ubuntu_xenial_debug//file",
entrypoint = ["/bin/server"],
repository = "istio",
tags = ["manual"],
Expand Down
9 changes: 9 additions & 0 deletions docker/manager_docker.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@bazel_tools//tools/build_defs/docker:docker.bzl", "docker_build")

def manager_docker_build(images, **kwargs):
for image in images:
docker_build(
name = image['name'],
base = image['base'],
**kwargs
)