Skip to content

Commit

Permalink
(from AES) Create a stripped Envoy image while keeping the original f…
Browse files Browse the repository at this point in the history
…ull image for

debugging purposes. This reduces build and CI time.
  • Loading branch information
John Esmet committed Nov 10, 2020
1 parent 6b9b396 commit 9f2e9c6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
8 changes: 5 additions & 3 deletions _cxx/envoy.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ IS_PRIVATE ?= $(findstring private,$(_git_remote_urls))
ENVOY_COMPILATION_MODE ?= opt
# Increment BASE_ENVOY_RELVER on changes to `docker/base-envoy/Dockerfile`, or Envoy recipes.
# You may reset BASE_ENVOY_RELVER when adjusting ENVOY_COMMIT.
BASE_ENVOY_RELVER ?= 1
BASE_ENVOY_RELVER ?= 4

ENVOY_DOCKER_REPO ?= $(if $(IS_PRIVATE),quay.io/datawire-private/ambassador-base,docker.io/datawire/ambassador-base)
ENVOY_DOCKER_VERSION ?= $(BASE_ENVOY_RELVER).$(ENVOY_COMMIT).$(ENVOY_COMPILATION_MODE)
ENVOY_DOCKER_TAG ?= $(ENVOY_DOCKER_REPO):envoy-$(ENVOY_DOCKER_VERSION)
ENVOY_FULL_DOCKER_TAG ?= $(ENVOY_DOCKER_REPO):envoy-full-$(ENVOY_DOCKER_VERSION)
# END LIST OF VARIABLES REQUIRING `make update-base`.

# for builder.sh...
Expand Down Expand Up @@ -215,9 +216,10 @@ $(OSS_HOME)/pkg/api/pb $(OSS_HOME)/pkg/api/envoy: $(OSS_HOME)/pkg/api/%: $(OSS_H
}

update-base: $(OSS_HOME)/_cxx/envoy-build-image.txt $(OSS_HOME)/docker/base-envoy/envoy-static $(OSS_HOME)/docker/base-envoy/envoy-static-stripped
docker build --build-arg=base=$$(cat $(OSS_HOME)/_cxx/envoy-build-image.txt) -t $(ENVOY_DOCKER_TAG) $(OSS_HOME)/docker/base-envoy
docker build -f $(OSS_HOME)/docker/base-envoy/Dockerfile.stripped -t $(ENVOY_DOCKER_TAG) $(OSS_HOME)/docker/base-envoy
docker build --build-arg=base=$$(cat $(OSS_HOME)/_cxx/envoy-build-image.txt) -t $(ENVOY_FULL_DOCKER_TAG) $(OSS_HOME)/docker/base-envoy
$(MAKE) generate
if [ '$(ENVOY_COMMIT)' != '-' ]; then docker push $(ENVOY_DOCKER_TAG); fi
if [ '$(ENVOY_COMMIT)' != '-' ]; then docker push $(ENVOY_DOCKER_TAG) && docker push $(ENVOY_FULL_DOCKER_TAG); fi
.PHONY: update-base

#
Expand Down
24 changes: 24 additions & 0 deletions docker/base-envoy/Dockerfile.stripped
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2020 Datawire. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License

################################################################
# If you have to change this file, you _must_ update BASE_ENVOY_RELVER
# in the Makefile, then run "make update-base" to build and push the
# new image.
FROM frolvlad/alpine-glibc:alpine-3.12_glibc-2.32

# We use rsync to move things in and out of the container.
RUN apk add rsync

ADD ./envoy-static-stripped /usr/local/bin

0 comments on commit 9f2e9c6

Please sign in to comment.