zmap/zdns

Issue installing zdns inside Docker

gorums opened this issue · 1 comments

Dockerfile


RUN apt-get update && apt-get install -y git wget unzip

Install Golang

RUN wget https://golang.org/dl/go1.16.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.16.linux-amd64.tar.gz
RUN export GOPATH=$HOME/go
RUN export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

RUN git clone https://github.com/zmap/zdns.git
RUN cd zdns/zdns && /usr/local/go/bin/go build


Output:
Step 31/32 : RUN cd zdns/zdns && /usr/local/go/bin/go build
---> Running in 602369823d69
go: github.com/miekg/dns@v1.1.27 (replaced by github.com/zmap/dns@v1.1.35-zdns-2): missing go.sum entry; to add it:
go mod download github.com/miekg/dns

Missing update of the go.sum file. Since Go 1.16 modules are no longer updated automatically (up to 1.15 it builds fine). The solution is the last line of the output:

go mod download github.com/miekg/dns

Simply run this command inside the project root before the “go build“ step like

RUN cd zdns && \
    /usr/local/go/bin/go mod download github.com/miegk/dns && \
    cd zdns && \
    /usr/local/go/bin/go build

Committing the the updated go.sum resolves the problem permanently.