Add Dockerfile for automatic build in DockerHub (#796)

* Add Dockerfile for automatic build in DockerHub

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Use build hooks to build docker images with SOURCE_BRANCH

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang
2017-07-27 12:29:17 -07:00
committed by GitHub
parent f5fbfce876
commit 10d354b784
2 changed files with 19 additions and 0 deletions

16
docker/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
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"]

3
docker/hooks/build Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
set -x
docker build --build-arg COREDNS_VERSION=$SOURCE_BRANCH -t $IMAGE_NAME .