Open ligouras opened 2 months ago
The problem is with the version of golang that is being used to build gopish (I dont know why it is working with the original and not here), but changing the version to 1.22 worked for me. Here is my Dockerfile for reference:
# Clone repo
FROM alpine AS clone
RUN apk add --no-cache git
RUN git clone https://github.com/kgretzky/gophish.git /tmp/gophish
FROM node:latest AS build-js
RUN npm install gulp gulp-cli -g
WORKDIR /build
COPY --from=clone /tmp/gophish .
RUN npm install --only=dev
RUN gulp
# Build Golang binary
FROM golang:1.22 AS build-golang
WORKDIR /go/src/github.com/gophish/gophish
COPY --from=clone /tmp/gophish .
RUN go get -v
RUN go build -v
# Runtime container
FROM debian:stable-slim
RUN useradd -m -d /opt/gophish -s /bin/bash app
RUN apt-get update && \
apt-get install --no-install-recommends -y jq libcap2-bin ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /opt/gophish
COPY --from=build-golang /go/src/github.com/gophish/gophish/ ./
COPY --from=build-js /build/static/js/dist/ ./static/js/dist/
COPY --from=build-js /build/static/css/dist/ ./static/css/dist/
RUN chown -R app:app ./
RUN setcap 'cap_net_bind_service=+ep' /opt/gophish/gophish
USER app
EXPOSE 333
CMD ["./gophish"]
Thank you @a5ucanc, changing golang version to 1.22 worked for me as well!
This is not exactly a bug for evilginx2, rather it has to do with kgretzky/gophish, which fails to build as a docker container:
gophish/gophish:8e79294 builds just fine.
I'm trying to fix this by looking at the diff, but I haven't been able to figure it out:
https://github.com/gophish/gophish/compare/master...kgretzky:gophish:master