mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-23 11:31:49 +01:00
3bfafa2f4c
* make coredns/Dockerfile use build stages This change makes the coredns Dockerfile use build stages to create the binaries which are then copied to the image for running. * removing deps
31 lines
743 B
Docker
31 lines
743 B
Docker
FROM alpine:latest as builder
|
|
LABEL maintainer "Jessie Frazelle <jess@linux.com>"
|
|
|
|
ENV PATH /go/bin:/usr/local/go/bin:$PATH
|
|
ENV GOPATH /go
|
|
|
|
RUN apk --no-cache add \
|
|
ca-certificates
|
|
|
|
ENV COREDNS_VERSION v1.2.2
|
|
|
|
RUN set -x \
|
|
&& apk --no-cache add \
|
|
go \
|
|
git \
|
|
gcc \
|
|
g++ \
|
|
libc-dev \
|
|
libgcc \
|
|
make \
|
|
&& git clone --depth 1 --branch ${COREDNS_VERSION} https://github.com/coredns/coredns /go/src/github.com/coredns/coredns \
|
|
&& cd /go/src/github.com/coredns/coredns \
|
|
&& make CHECKS="godeps" \
|
|
&& mv coredns /usr/bin/coredns \
|
|
&& echo "Build complete."
|
|
|
|
FROM alpine:latest
|
|
|
|
COPY --from=builder /usr/bin/coredns /usr/bin/coredns
|
|
|
|
ENTRYPOINT [ "coredns", "-log" ] |