Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unify bazel's docker build targets with other istio repos #127

Merged
merged 2 commits into from
Feb 25, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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
)