forked from insomniacslk/dublin-traceroute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.integ
63 lines (54 loc) · 1.66 KB
/
Dockerfile.integ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM ubuntu:20.10
LABEL BUILD="docker build -t insomniacslk/dublin-traceroute-integ -f Dockerfile.integ ."
# --privileged required for nfqueue
LABEL RUN="docker run --rm --privileged -it insomniacslk/dublin-traceroute-integ"
# Install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
sudo \
# to fetch the Go toolchain
ca-certificates \
wget \
# for go get
git \
# for routest
iptables \
# for dublin-traceroute
build-essential cmake \
pkg-config libtins-dev libjsoncpp-dev \
&& \
rm -rf /var/lib/apt/lists/*
# install Go
WORKDIR /tmp
RUN set -exu; \
wget https://golang.org/dl/go1.15.6.linux-amd64.tar.gz ;\
tar -C / -xvzf go1.15.6.linux-amd64.tar.gz
ENV PATH="$PATH:/go/bin:/build/bin"
ENV GOPATH=/go/path:/build
ENV PROJDIR=/build/src/github.com/insomniacslk/dublin-traceroute
RUN mkdir -p $PROJDIR
COPY . $PROJDIR
# build and install routest
WORKDIR /build/src
RUN set -exu; \
cd $PROJDIR/go/dublintraceroute/cmd/routest ;\
go get -v ./... ;\
go build ;\
go install .
# build dublin-traceroute (CPP)
RUN set -exu ;\
cd $PROJDIR ;\
rm -rf build; mkdir build; cd build ;\
cmake .. ;\
make ;\
make install
# build dublin-traceroute (Go)
RUN set -exu ;\
cd $PROJDIR/go/dublintraceroute/cmd/dublin-traceroute ;\
go get -v ./... ;\
go build
# run tests
RUN set -exu ;\
go get -v -t github.com/stretchr/testify
CMD set -exu ;\
timeout 60 go test -v -race -coverprofile=/build/coverage/profile.out -covermode=atomic github.com/insomniacslk/dublin-traceroute/integ