From ce1dd59f04951555ff22fe8702fc02bf646036e4 Mon Sep 17 00:00:00 2001 From: Adrian Moreno Date: Tue, 12 Jan 2021 11:51:40 +0100 Subject: [PATCH] Dockerfile: run go get in container creation This significantly speeds up test execution Signed-off-by: Adrian Moreno --- Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 40178b8..682247c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ libssl-dev \ llvm-dev \ libjemalloc-dev \ - libnuma-dev \ + libnuma-dev \ python-sphinx \ libelf-dev \ selinux-policy-dev \ @@ -15,8 +15,15 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ automake \ libtool -ADD .travis /src/travis -WORKDIR /src/travis +# Cache go mod dependencies to speed up test execution +WORKDIR /src +ADD go.mod /src/ +ADD go.sum /src/ +ENV GO111MODULE=on +RUN go get -v ./... +# Prepare the environment (builds ovsdb) +WORKDIR /src/travis +ADD .travis /src/travis ENV OVN_SRCDIR=/src/ RUN sh ./test_prepare.sh