simplified Dockerfile and improved build process

This commit is contained in:
evilsocket 2018-04-18 12:05:29 +02:00
commit 3b22341e34
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
3 changed files with 22934 additions and 22934 deletions

View file

@ -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"]

View file

@ -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).*

View file

@ -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 {