Last active
August 4, 2017 14:53
-
-
Save xynova/fbdcf67a241bdc52ffe93c5b1d0cb174 to your computer and use it in GitHub Desktop.
Docker Build confd and packages into nginx alpine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BUILD CONFD STAGE | |
# | |
FROM golang:1.8.3-alpine3.6 AS confd-build-stage | |
WORKDIR /go/src/github.com/kelseyhightower | |
RUN apk --update add git bash | |
RUN git clone --depth 1 https://github.com/kelseyhightower/confd.git \ | |
&& cd confd \ | |
&& ./build \ | |
&& chmod +x bin/confd | |
RUN mkdir -p /etc/confd/conf.d /etc/confd/templates | |
# PACKAGING STAGE | |
# | |
FROM nginx:alpine | |
COPY --from=confd-build-stage /go/src/github.com/kelseyhightower/confd/bin/confd /usr/local/bin/ | |
COPY --from=confd-build-stage /etc/confd/ /etc/confd/ | |
COPY ./nginx-confd.sh /usr/local/bin/nginx-confd | |
VOLUME /etc/confd | |
CMD ["nginx-confd"] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment