ARG ARCH=amd64 ARG DISTRO=debian ARG TEST_BASE=debian ARG DISTRO_VERSION=10 ARG PKG_VERSION=0.1 FROM netdata/package-builders:${DISTRO}${DISTRO_VERSION} AS build ARG ARCH ARG DISTRO ARG DISTRO_VERSION ARG PKG_VERSION ENV ARCH=$ARCH ENV DISTRO=$DISTRO ENV DISTRO_VERSION=$DISTRO_VERSION ENV VERSION=$PKG_VERSION WORKDIR /netdata COPY . . RUN /build.sh FROM ${TEST_BASE}:${DISTRO_VERSION} AS runtime ARG ARCH ARG DISTRO ARG DISTRO_VERSION ARG PKG_VERSION ENV ARCH=$ARCH ENV DISTRO=$DISTRO ENV DISTRO_VERSION=$DISTRO_VERSION ENV VERSION=$PKG_VERSION COPY ./packaging/scripts/install.sh /install.sh COPY ./packaging/scripts/test.sh /test.sh COPY --from=build /netdata/artifacts /packages RUN /install.sh CMD ["/test.sh"]