Skip to content

Commit

Permalink
Build confd as a part of the Dockerfiles so that we get ARCH specific…
Browse files Browse the repository at this point in the history
… versions. (#2753)
  • Loading branch information
cooperaj authored Aug 23, 2024
1 parent ba9a35d commit 71047c0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
20 changes: 11 additions & 9 deletions service-api/docker/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
FROM golang:1.23-alpine AS confd_builder

RUN apk add --no-cache make git && \
cd / && \
git clone https://github.com/kelseyhightower/confd.git build && \
cd build && \
git checkout 919444eb && \
make build

FROM nginxinc/nginx-unprivileged:stable-alpine
USER root

RUN apk upgrade && \
apk update curl

# Add Confd to configure nginx on start
ENV CONFD_VERSION="0.16.0"

RUN wget -q -O /usr/local/bin/confd "https://github.com/kelseyhightower/confd/releases/download/v${CONFD_VERSION}/confd-${CONFD_VERSION}-linux-amd64" \
&& chmod +x /usr/local/bin/confd

# Add Waitforit to wait on app starting
ENV WAITFORIT_VERSION="v2.4.1"
RUN wget -q -O /usr/local/bin/waitforit https://github.com/maxcnunes/waitforit/releases/download/$WAITFORIT_VERSION/waitforit-linux_amd64 \
&& chmod +x /usr/local/bin/waitforit
COPY --from=confd_builder /build/bin/confd /usr/local/bin/confd
RUN chmod +x /usr/local/bin/confd

COPY service-api/docker/web/etc /etc

Expand Down
19 changes: 11 additions & 8 deletions service-front/docker/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
FROM golang:1.23-alpine AS confd_builder

RUN apk add --no-cache make git && \
cd / && \
git clone https://github.com/kelseyhightower/confd.git build && \
cd build && \
git checkout 919444eb && \
make build

FROM nginxinc/nginx-unprivileged:stable-alpine
USER root

RUN apk upgrade && \
apk update curl

# Add Confd to configure nginx on start
ENV CONFD_VERSION="0.16.0"
RUN wget -q -O /usr/local/bin/confd "https://github.com/kelseyhightower/confd/releases/download/v${CONFD_VERSION}/confd-${CONFD_VERSION}-linux-amd64" \
&& chmod +x /usr/local/bin/confd

# Add Waitforit to wait on app starting
ENV WAITFORIT_VERSION="v2.4.1"
RUN wget -q -O /usr/local/bin/waitforit https://github.com/maxcnunes/waitforit/releases/download/$WAITFORIT_VERSION/waitforit-linux_amd64 \
&& chmod +x /usr/local/bin/waitforit
COPY --from=confd_builder /build/bin/confd /usr/local/bin/confd
RUN chmod +x /usr/local/bin/confd

COPY service-front/docker/web/etc /etc
COPY service-front/docker/web/web /web
Expand Down

0 comments on commit 71047c0

Please sign in to comment.