Skip to content

Instantly share code, notes, and snippets.

@xynova
Last active August 4, 2017 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xynova/fbdcf67a241bdc52ffe93c5b1d0cb174 to your computer and use it in GitHub Desktop.
Save xynova/fbdcf67a241bdc52ffe93c5b1d0cb174 to your computer and use it in GitHub Desktop.
Docker Build confd and packages into nginx alpine
# 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