Updated the Dockerfile to allow the gophish binary to bind to privileged ports. Fixes #1660.

pull/1400/head^2
Jordan Wright 2019-11-23 21:28:28 -06:00
parent 1aab1a34ba
commit c2f579a2c5
1 changed files with 3 additions and 1 deletions

View File

@ -23,7 +23,7 @@ FROM debian:stable-slim
RUN useradd -m -d /opt/gophish -s /bin/bash app RUN useradd -m -d /opt/gophish -s /bin/bash app
RUN apt-get update && \ RUN apt-get update && \
apt-get install --no-install-recommends -y jq && \ apt-get install --no-install-recommends -y jq libcap2-bin && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@ -34,6 +34,8 @@ COPY --from=build-js /build/static/css/dist/ ./static/css/dist/
COPY --from=build-golang /go/src/github.com/gophish/gophish/config.json ./ COPY --from=build-golang /go/src/github.com/gophish/gophish/config.json ./
RUN chown app. config.json RUN chown app. config.json
RUN setcap 'cap_net_bind_service=+ep' /opt/gophish/gophish
USER app USER app
RUN sed -i 's/127.0.0.1/0.0.0.0/g' config.json RUN sed -i 's/127.0.0.1/0.0.0.0/g' config.json
RUN touch config.json.tmp RUN touch config.json.tmp