diff --git a/WORKSPACE b/WORKSPACE index 3b255e3fa7a..69546d28831 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -85,3 +85,11 @@ docker_build( type = "zip", url = "https://codeload.github.com/tianon/docker-brew-ubuntu-core/zip/e406914e5f648003dfe8329b512c30c9ad0d2f9c", ) + +# See github.com/istio/manager/blob/master/docker/debug/build-and-publish-debug-image.sh +# for instructions on how to re-build and publish this base image layer. +http_file( + name = "ubuntu_xenial_debug", + url = "https://storage.googleapis.com/istio-build/manager/ubuntu_xenial_debug.tar.gz", + sha256 = "02f0ea4b04012562dec4b75ee4337ac77a0003418d02a91bde1b4b4d162a41e4", +) diff --git a/docker/BUILD b/docker/BUILD new file mode 100644 index 00000000000..6e017ee6064 --- /dev/null +++ b/docker/BUILD @@ -0,0 +1,11 @@ +# Add aliases for envoy specific targets so that the docker build +# targets are consistent for all istio repos, e.g. //docker: +alias( + name = "proxy", + actual = "//src/envoy/mixer:proxy", +) + +alias( + name = "proxy_debug", + actual = "//src/envoy/mixer:proxy_debug", +) diff --git a/src/envoy/mixer/BUILD b/src/envoy/mixer/BUILD index d04b5105029..132bc364a1d 100644 --- a/src/envoy/mixer/BUILD +++ b/src/envoy/mixer/BUILD @@ -15,8 +15,9 @@ ################################################################################ # + load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") -load("@bazel_tools//tools/build_defs/docker:docker.bzl", "docker_build") +load("//src/envoy/mixer:proxy_docker.bzl", "proxy_docker_build") load("@protobuf_git//:protobuf.bzl", "cc_proto_library") cc_proto_library( @@ -79,9 +80,11 @@ pkg_tar( tags = ["manual"], ) -docker_build( - name = "proxy", - base = "@docker_ubuntu//:xenial", +proxy_docker_build( + images = [ + {"name": "proxy", "base": "@docker_ubuntu//:xenial"}, + {"name": "proxy_debug", "base": "@ubuntu_xenial_debug//file"}, + ], entrypoint = [ "/usr/local/bin/start_envoy", "-e", @@ -99,4 +102,5 @@ docker_build( ":envoy_tar", ":start_envoy_tar", ], + visibility = ["//visibility:public"], ) diff --git a/src/envoy/mixer/proxy_docker.bzl b/src/envoy/mixer/proxy_docker.bzl new file mode 100644 index 00000000000..8522729628f --- /dev/null +++ b/src/envoy/mixer/proxy_docker.bzl @@ -0,0 +1,9 @@ +load("@bazel_tools//tools/build_defs/docker:docker.bzl", "docker_build") + +def proxy_docker_build(images, **kwargs): + for image in images: + docker_build( + name = image['name'], + base = image['base'], + **kwargs + )