Skip to content

Commit

Permalink
Add build for the nanny docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
bowei committed Feb 17, 2017
1 parent 9cd64b6 commit edac34a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
20 changes: 20 additions & 0 deletions Dockerfile.dnsmasq-nanny
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2016 The Kubernetes Authors.
#
# 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.
FROM gcr.io/google_containers/k8s-dns-dnsmasq-ARG_ARCH:ARG_VERSION

MAINTAINER Bowei Du <[email protected]>

RUN mkdir -p /etc/k8s/dns/dnsmasq-nanny
ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
ENTRYPOINT ["/ARG_BIN"]
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ VERBOSE ?= 0

# Include standard build rules.
include rules.mk

# Additional rule to ensure that the dnsmasq image is built before the
# dnsmasq-nanny image.
BINARY := dnsmasq-nanny
.$(BUILDSTAMP_NAME)-container: images-containers
10 changes: 6 additions & 4 deletions rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ else
VERBOSE_OUTPUT := >/dev/null
endif

# This MUST appear as the first rule in a Makefile
all: build

build-%:
Expand Down Expand Up @@ -122,10 +123,11 @@ define DOCKERFILE_RULE
.$(BINARY)-$(ARCH)-dockerfile: Dockerfile.$(BINARY)
@echo generating Dockerfile $$@ from $$<
@sed \
-e 's|ARG_BIN|$(BINARY)|g' \
-e 's|ARG_ARCH|$(ARCH)|g' \
-e 's|ARG_FROM|$(BASEIMAGE)|g' \
-e 's|ARG_NOBODY|$(NOBODY)|g' \
-e 's|ARG_ARCH|$(ARCH)|g' \
-e 's|ARG_BIN|$(BINARY)|g' \
-e 's|ARG_FROM|$(BASEIMAGE)|g' \
-e 's|ARG_NOBODY|$(NOBODY)|g' \
-e 's|ARG_VERSION|$(VERSION)|g' \
$$< > $$@
.$(BUILDSTAMP_NAME)-container: .$(BINARY)-$(ARCH)-dockerfile
endef
Expand Down

0 comments on commit edac34a

Please sign in to comment.