From 58a82ddcd638693c5b9e5c61266c301fd40b0408 Mon Sep 17 00:00:00 2001 From: bunkerity Date: Mon, 18 Jul 2022 15:47:30 +0200 Subject: [PATCH] tests - copy Linux packages to local directory --- tests/Dockerfile-centos | 3 +-- tests/Dockerfile-debian | 3 +-- tests/Dockerfile-fedora | 3 +-- tests/Dockerfile-ubuntu | 3 +-- tests/linux.sh | 13 ++++++++----- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/Dockerfile-centos b/tests/Dockerfile-centos index f75baa342..b662cb55e 100644 --- a/tests/Dockerfile-centos +++ b/tests/Dockerfile-centos @@ -18,8 +18,7 @@ COPY linux/nginx.repo /etc/yum.repos.d/nginx.repo RUN dnf install yum-utils epel-release -y && \ dnf install nginx-1.20.2 -y -ARG target=dev -COPY /opt/packages/${target}/centos/*.rpm /opt +COPY ./packages/centos/*.rpm /opt RUN dnf install -y /opt/*.rpm VOLUME /run /tmp diff --git a/tests/Dockerfile-debian b/tests/Dockerfile-debian index e6ed9c581..cad089b47 100644 --- a/tests/Dockerfile-debian +++ b/tests/Dockerfile-debian @@ -31,8 +31,7 @@ RUN apt update && \ apt-get update && \ apt-get install -y --no-install-recommends nginx=${NGINX_VERSION}-1~bullseye -ARG target=dev -COPY /opt/packages/${target}/debian/*.deb /opt +COPY ./packages/debian/*.deb /opt RUN apt install -y /opt/*.deb VOLUME [ "/sys/fs/cgroup" ] diff --git a/tests/Dockerfile-fedora b/tests/Dockerfile-fedora index d4f920191..6e43ce8e3 100644 --- a/tests/Dockerfile-fedora +++ b/tests/Dockerfile-fedora @@ -22,8 +22,7 @@ RUN dnf update -y && \ dnf install -y curl gnupg2 ca-certificates redhat-lsb-core python3-pip && \ dnf install nginx-1.20.2 -y -ARG target=dev -COPY /opt/packages/${target}/fedora/*.rpm /opt +COPY ./packages/fedora/*.rpm /opt RUN dnf install -y /opt/*.rpm VOLUME [ "/sys/fs/cgroup" ] diff --git a/tests/Dockerfile-ubuntu b/tests/Dockerfile-ubuntu index ddf2f8d3f..46f7244ae 100644 --- a/tests/Dockerfile-ubuntu +++ b/tests/Dockerfile-ubuntu @@ -31,8 +31,7 @@ RUN apt update && \ apt-get update && \ apt-get install -y --no-install-recommends nginx=${NGINX_VERSION}-1~jammy -ARG target=dev -COPY /opt/packages/${target}/ubuntu/*.deb /opt +COPY ./packages/ubuntu/*.deb /opt RUN apt install -y /opt/*.deb VOLUME [ "/sys/fs/cgroup" ] diff --git a/tests/linux.sh b/tests/linux.sh index c5c00b01c..78307ecd9 100755 --- a/tests/linux.sh +++ b/tests/linux.sh @@ -22,7 +22,7 @@ function gen_package() { function build_image() { mode="$1" linux="$2" - do_and_check_cmd docker build -t "bw-${linux}" --build-arg "target=${mode}" -f "./tests/Dockerfile-${linux}" . + do_and_check_cmd docker build -t "bw-${linux}" -f "./tests/Dockerfile-${linux}" . } echo "Linux tests" @@ -43,10 +43,13 @@ gen_package "$1" "debian" gen_package "$1" "centos" gen_package "$1" "fedora" +# Copy packages in the Docker context +do_and_check_cmd cp -r "/opt/packages/$1" ./packages + # Build test images -build_image "$1" "ubuntu" -build_image "$1" "debian" -build_image "$1" "centos" -build_image "$1" "fedora" +build_image "ubuntu" +build_image "debian" +build_image "centos" +build_image "fedora" exit 0