mirror of
https://github.com/coredns/coredns.git
synced 2025-11-23 04:12:17 -05:00
Use pre_build hook in docker hub to build the coredns binary (#799)
and skip the download process. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
2
Makefile
2
Makefile
@@ -8,7 +8,7 @@ all: coredns
|
|||||||
# TODO: Add .go file dependencies.
|
# TODO: Add .go file dependencies.
|
||||||
.PHONY: coredns
|
.PHONY: coredns
|
||||||
coredns: check godeps
|
coredns: check godeps
|
||||||
go build $(BUILD_VERBOSE) -ldflags="-s -w"
|
CGO_ENABLED=0 go build $(BUILD_VERBOSE) -ldflags="-s -w"
|
||||||
|
|
||||||
.PHONY: deps
|
.PHONY: deps
|
||||||
deps: core/zmiddleware.go core/dnsserver/zdirectives.go godeps
|
deps: core/zmiddleware.go core/dnsserver/zdirectives.go godeps
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
FROM alpine:latest
|
|
||||||
MAINTAINER Miek Gieben <miek@coredns.io> @miekg
|
|
||||||
|
|
||||||
# only need ca-certificates & openssl if want to use https_google
|
|
||||||
RUN apk --update add bind-tools ca-certificates openssl && update-ca-certificates && rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
ARG COREDNS_VERSION=latest
|
|
||||||
|
|
||||||
RUN echo build coredns v$COREDNS_VERSION
|
|
||||||
|
|
||||||
ADD https://github.com/coredns/coredns/releases/download/v${COREDNS_VERSION}/coredns_${COREDNS_VERSION}_linux_x86_64.tgz /
|
|
||||||
|
|
||||||
RUN tar -xzf coredns_${COREDNS_VERSION}_linux_x86_64.tgz && rm coredns_${COREDNS_VERSION}_linux_x86_64.tgz
|
|
||||||
|
|
||||||
EXPOSE 53 53/udp
|
|
||||||
ENTRYPOINT ["/coredns"]
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -x
|
|
||||||
docker build --build-arg COREDNS_VERSION=$SOURCE_BRANCH -t $IMAGE_NAME .
|
|
||||||
7
hooks/pre_build
Normal file
7
hooks/pre_build
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
echo "=> Building the CoreDNS binary"
|
||||||
|
docker run \
|
||||||
|
-v $(pwd):/go/src/github.com/coredns/coredns \
|
||||||
|
-w /go/src/github.com/coredns/coredns \
|
||||||
|
golang:1.8.0 \
|
||||||
|
make
|
||||||
Reference in New Issue
Block a user