@cryptotaxi247 / netdata-1 / commits / 49096cc0e

docker: use base images build by us (#5465)

* docker: use base images build by us * remove $OUTPUT hack

Paweł Krupa committed Feb 25, 2019 at 11:27 UTC 49096cc0e8a4179c56d6a89f63814f6096ac750f
2 files changed +7 -43
packaging/docker/Dockerfile
+6 -41
@@ -3,38 +3,16 @@
3
4 # Cross-arch building is achieved by specifying ARCH as a build parameter with `--build-arg` option.
5 # It is automated in `build.sh` script
6 -ARG ARCH=amd64-v3.8
7 -FROM multiarch/alpine:${ARCH} as builder
8 -
9 -ARG OUTPUT="/dev/stdout"
10 -# Install prerequisites
11 -RUN apk --no-cache add alpine-sdk \
12 - autoconf \
13 - automake \
14 - bash \
15 - build-base \
16 - curl \
17 - jq \
18 - libmnl-dev \
19 - libuuid \
20 - lm_sensors \
21 - netcat-openbsd \
22 - nodejs \
23 - pkgconfig \
24 - py-mysqldb \
25 - py-psycopg2 \
26 - py-yaml \
27 - python \
28 - util-linux-dev \
29 - zlib-dev
6 +ARG ARCH=amd64
7 +# This image contains preinstalled dependecies
8 +FROM netdata/builder:${ARCH} as builder
9
10 # Copy source
11 COPY . /opt/netdata.git
12 WORKDIR /opt/netdata.git
13
14 # Install from source
36 -RUN chmod +x netdata-installer.sh && \
37 - ./netdata-installer.sh --dont-wait --dont-start-it &>${OUTPUT}
15 +RUN chmod +x netdata-installer.sh && ./netdata-installer.sh --dont-wait --dont-start-it
16
17 # files to one directory
18 RUN mkdir -p /app/usr/sbin/ \
@@ -56,20 +34,8 @@ RUN mkdir -p /app/usr/sbin/ \
34
35 #####################################################################
36 ARG ARCH
59 -FROM multiarch/alpine:${ARCH}
60 -
61 -# Install some prerequisites
62 -RUN apk --no-cache add curl \
63 - fping \
64 - jq \
65 - libuuid \
66 - lm_sensors \
67 - netcat-openbsd \
68 - nodejs \
69 - py-mysqldb \
70 - py-psycopg2 \
71 - py-yaml \
72 - python
37 +# This image contains preinstalled dependecies
38 +FROM netdata/base:${ARCH}
39
40 # Conditional subscribiton to Polyverse's Polymorphic Linux repositories
41 RUN if [ "$(uname -m)" == "x86_64" ]; then \
@@ -79,7 +45,6 @@ RUN if [ "$(uname -m)" == "x86_64" ]; then \
45 sed -in 's/^#//g' /etc/apk/repositories; \
46 fi
47
82 -
48 # Copy files over
49 COPY --from=builder /app /
50
packaging/docker/build.sh
+1 -2
@@ -38,8 +38,7 @@ docker run --rm --privileged multiarch/qemu-user-static:register --reset
38 # Build images using multi-arch Dockerfile.
39 for ARCH in "${ARCHITECTURES[@]}"; do
40 eval docker build \
41 - --build-arg ARCH="${ARCH}-v3.8" \
42 - --build-arg OUTPUT=/dev/null \
41 + --build-arg ARCH="${ARCH}" \
42 --tag "${REPOSITORY}:${VERSION}-${ARCH}" \
43 --file packaging/docker/Dockerfile ./
44 done