Commit 53872bb2 authored by Martin Linkhorst's avatar Martin Linkhorst Committed by Yerken
Browse files

build docker image with google container builder (#68)

* chore: build docker image with google container builder

* chore: add boilerplate header
parent 8e3f14a0
Showing with 55 additions and 1 deletion
+55 -1
Dockerfile 0 → 100644
# Copyright 2017 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 alpine:3.5
COPY build/linux-amd64/external-dns /external-dns
ENTRYPOINT ["/external-dns"]
......@@ -36,4 +36,23 @@ test:
verify: test
vendor/github.com/kubernetes/repo-infra/verify/verify-boilerplate.sh --rootdir=${CURDIR}
vendor/github.com/kubernetes/repo-infra/verify/verify-go-src.sh -v --rootdir ${CURDIR}
# The build targets allow to build the binary and docker image
.PHONY: build build.docker
PROJECT ?= zalando-docker
BINARY ?= external-dns
SOURCES = $(shell find . -name '*.go')
IMAGE ?= gcr.io/$(PROJECT)/$(BINARY)
VERSION ?= $(shell git describe --tags --always --dirty)
build: build/$(BINARY)
build/$(BINARY): $(SOURCES)
CGO_ENABLED=0 go build -o build/$(BINARY) .
build.docker: build/linux-amd64/$(BINARY)
docker build --rm --tag "$(IMAGE):$(VERSION)" .
build/linux-amd64/$(BINARY): $(SOURCES)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/linux-amd64/$(BINARY) .
steps:
- name: gcr.io/cloud-builders/go
args:
- build
- -o=build/linux-amd64/external-dns
- .
env:
- PROJECT_ROOT=github.com/kubernetes-incubator/external-dns
- name: gcr.io/cloud-builders/docker
args:
- build
- --tag=gcr.io/$PROJECT_ID/external-dns
- .
images:
- gcr.io/$PROJECT_ID/external-dns
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment