summaryrefslogtreecommitdiffstats
path: root/packaging/Dockerfile.packager
blob: 4c90f14fd8008d049d863f37126b306ea159e1d0 (plain)
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
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"]