| 1 |
# build stage |
| 2 |
FROM golang:1.22-alpine3.20 AS build-env |
| 3 |
|
| 4 |
RUN apk add --no-cache ca-certificates |
| 5 |
RUN apk add --no-cache bash gcc g++ binutils-gold iptables wireless-tools build-base libpcap-dev libusb-dev linux-headers libnetfilter_queue-dev git |
| 6 |
|
| 7 |
WORKDIR $GOPATH/src/github.com/bettercap/bettercap |
| 8 |
ADD . $GOPATH/src/github.com/bettercap/bettercap |
| 9 |
RUN make |
| 10 |
|
| 11 |
# get caplets |
| 12 |
RUN mkdir -p /usr/local/share/bettercap |
| 13 |
RUN git clone https://github.com/bettercap/caplets /usr/local/share/bettercap/caplets |
| 14 |
|
| 15 |
# final stage |
| 16 |
FROM alpine:3.20 |
| 17 |
RUN apk add --no-cache ca-certificates |
| 18 |
RUN apk add --no-cache bash iproute2 libpcap libusb-dev libnetfilter_queue wireless-tools |
| 19 |
COPY --from=build-env /go/src/github.com/bettercap/bettercap/bettercap /app/ |
| 20 |
COPY --from=build-env /usr/local/share/bettercap/caplets /app/ |
| 21 |
WORKDIR /app |
| 22 |
|
| 23 |
EXPOSE 80 443 53 5300 8080 8081 8082 8083 8000 |
| 24 |
ENTRYPOINT ["/app/bettercap"] |