-
Notifications
You must be signed in to change notification settings - Fork 57
/
Dockerfile.integ
60 lines (52 loc) · 1.6 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
FROM ubuntu:22.04
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.21.13.linux-amd64.tar.gz ;\
tar -C / -xvzf go1.21.13.linux-amd64.tar.gz
ENV PATH="$PATH:/go/bin:/build/bin"
ENV GOPATH=/go:/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
CMD set -exu ;\
cd $PROJDIR ;\
timeout 60 go test -v -race -coverprofile=/build/coverage/profile.out -covermode=atomic github.com/insomniacslk/dublin-traceroute/integ