mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
simplified Dockerfile and improved build process
This commit is contained in:
parent
00e6c3dc84
commit
3b22341e34
3 changed files with 22934 additions and 22934 deletions
|
@ -1,20 +1,21 @@
|
||||||
# build stage
|
# build stage
|
||||||
FROM golang:1.10-alpine AS build-env
|
FROM golang:1.10-alpine AS build-env
|
||||||
ENV GOPATH=/gocode
|
|
||||||
ENV SRC_DIR=/gocode/src/github.com/bettercap/bettercap
|
ENV SRC_DIR $GOPATH/src/github.com/bettercap/bettercap
|
||||||
|
|
||||||
RUN apk add --update ca-certificates
|
RUN apk add --update ca-certificates
|
||||||
RUN apk add --no-cache --update bash iptables wireless-tools build-base libpcap-dev linux-headers libnetfilter_queue-dev git python py-six
|
RUN apk add --no-cache --update bash iptables wireless-tools build-base libpcap-dev linux-headers libnetfilter_queue-dev git
|
||||||
|
|
||||||
WORKDIR $SRC_DIR
|
WORKDIR $SRC_DIR
|
||||||
ADD . $SRC_DIR
|
ADD . $SRC_DIR
|
||||||
|
RUN go get -u github.com/golang/dep/...
|
||||||
RUN make deps
|
RUN make deps
|
||||||
RUN make
|
RUN make
|
||||||
|
|
||||||
# final stage
|
# final stage
|
||||||
FROM alpine
|
FROM alpine
|
||||||
RUN apk add --no-cache --update bash iproute2 libpcap libnetfilter_queue
|
RUN apk add --no-cache --update bash iproute2 libpcap libnetfilter_queue
|
||||||
COPY --from=build-env /gocode/src/github.com/bettercap/bettercap/bettercap /app/
|
COPY --from=build-env /go/src/github.com/bettercap/bettercap/bettercap /app/
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 80 443 53 5300 8080 8081 8082 8083 8000
|
EXPOSE 80 443 53 5300 8080 8081 8082 8083 8000
|
||||||
ENTRYPOINT ["/app/bettercap"]
|
ENTRYPOINT ["/app/bettercap"]
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -10,9 +10,9 @@ build: resources
|
||||||
@echo "@ Building ..."
|
@echo "@ Building ..."
|
||||||
@go build -o $(TARGET) .
|
@go build -o $(TARGET) .
|
||||||
|
|
||||||
resources: oui
|
resources: network/oui.go
|
||||||
|
|
||||||
oui:
|
network/oui.go:
|
||||||
@python ./network/make_oui.py
|
@python ./network/make_oui.py
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
|
@ -25,7 +25,7 @@ lint:
|
||||||
@golint ./...
|
@golint ./...
|
||||||
|
|
||||||
deps:
|
deps:
|
||||||
@go get ./...
|
@dep ensure
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -rf $(TARGET).*
|
@rm -rf $(TARGET).*
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var oui = map[string]string {
|
var oui = map[string]string{
|
||||||
"681605": "Systems And Electronic Development Fzco",
|
"681605": "Systems And Electronic Development Fzco",
|
||||||
"74dbd1": "Ebay",
|
"74dbd1": "Ebay",
|
||||||
"000099": "MTX",
|
"000099": "MTX",
|
||||||
|
@ -22932,7 +22932,6 @@ var oui = map[string]string {
|
||||||
"784b87": "Murata Manufacturing Co.",
|
"784b87": "Murata Manufacturing Co.",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func OuiLookup(mac string) string {
|
func OuiLookup(mac string) string {
|
||||||
octects := strings.Split(mac, ":")
|
octects := strings.Split(mac, ":")
|
||||||
if len(octects) > 3 {
|
if len(octects) > 3 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue