Skip to content

Commit

Permalink
unify bazel's docker build targets with other istio repos (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayj authored and qiwzhang committed Feb 25, 2017
1 parent fdfb73f commit 3d402e6
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
8 changes: 8 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
11 changes: 11 additions & 0 deletions docker/BUILD
Original file line number Diff line number Diff line change
@@ -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:<image>
alias(
name = "proxy",
actual = "//src/envoy/mixer:proxy",
)

alias(
name = "proxy_debug",
actual = "//src/envoy/mixer:proxy_debug",
)
12 changes: 8 additions & 4 deletions src/envoy/mixer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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",
Expand All @@ -99,4 +102,5 @@ docker_build(
":envoy_tar",
":start_envoy_tar",
],
visibility = ["//visibility:public"],
)
9 changes: 9 additions & 0 deletions src/envoy/mixer/proxy_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 proxy_docker_build(images, **kwargs):
for image in images:
docker_build(
name = image['name'],
base = image['base'],
**kwargs
)

0 comments on commit 3d402e6

Please sign in to comment.