tests - copy Linux packages to local directory
This commit is contained in:
parent
8062d043c1
commit
58a82ddcd6
|
@ -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
|
||||
|
|
|
@ -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" ]
|
||||
|
|
|
@ -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" ]
|
||||
|
|
|
@ -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" ]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue