diff options
author | Paweł Krupa <pawel@krupa.net.pl> | 2019-02-25 11:27:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-25 11:27:31 +0100 |
commit | 49096cc0e8a4179c56d6a89f63814f6096ac750f (patch) | |
tree | 4856ae3c24ca9e5e8f05d57baebd6f3f11c52735 /packaging | |
parent | d1f076e84281e63f09d951a85896a0689d11a66b (diff) |
docker: use base images build by us (#5465)
* docker: use base images build by us
* remove $OUTPUT hack
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/docker/Dockerfile | 47 | ||||
-rwxr-xr-x | packaging/docker/build.sh | 3 |
2 files changed, 7 insertions, 43 deletions
diff --git a/packaging/docker/Dockerfile b/packaging/docker/Dockerfile index 73cd9030f5..8d1205add9 100644 --- a/packaging/docker/Dockerfile +++ b/packaging/docker/Dockerfile @@ -3,38 +3,16 @@ # Cross-arch building is achieved by specifying ARCH as a build parameter with `--build-arg` option. # It is automated in `build.sh` script -ARG ARCH=amd64-v3.8 -FROM multiarch/alpine:${ARCH} as builder - -ARG OUTPUT="/dev/stdout" -# Install prerequisites -RUN apk --no-cache add alpine-sdk \ - autoconf \ - automake \ - bash \ - build-base \ - curl \ - jq \ - libmnl-dev \ - libuuid \ - lm_sensors \ - netcat-openbsd \ - nodejs \ - pkgconfig \ - py-mysqldb \ - py-psycopg2 \ - py-yaml \ - python \ - util-linux-dev \ - zlib-dev +ARG ARCH=amd64 +# This image contains preinstalled dependecies +FROM netdata/builder:${ARCH} as builder # Copy source COPY . /opt/netdata.git WORKDIR /opt/netdata.git # Install from source -RUN chmod +x netdata-installer.sh && \ - ./netdata-installer.sh --dont-wait --dont-start-it &>${OUTPUT} +RUN chmod +x netdata-installer.sh && ./netdata-installer.sh --dont-wait --dont-start-it # files to one directory RUN mkdir -p /app/usr/sbin/ \ @@ -56,20 +34,8 @@ RUN mkdir -p /app/usr/sbin/ \ ##################################################################### ARG ARCH -FROM multiarch/alpine:${ARCH} - -# Install some prerequisites -RUN apk --no-cache add curl \ - fping \ - jq \ - libuuid \ - lm_sensors \ - netcat-openbsd \ - nodejs \ - py-mysqldb \ - py-psycopg2 \ - py-yaml \ - python +# This image contains preinstalled dependecies +FROM netdata/base:${ARCH} # Conditional subscribiton to Polyverse's Polymorphic Linux repositories RUN if [ "$(uname -m)" == "x86_64" ]; then \ @@ -79,7 +45,6 @@ RUN if [ "$(uname -m)" == "x86_64" ]; then \ sed -in 's/^#//g' /etc/apk/repositories; \ fi - # Copy files over COPY --from=builder /app / diff --git a/packaging/docker/build.sh b/packaging/docker/build.sh index 6958f05e88..0d6caaa6f8 100755 --- a/packaging/docker/build.sh +++ b/packaging/docker/build.sh @@ -38,8 +38,7 @@ docker run --rm --privileged multiarch/qemu-user-static:register --reset # Build images using multi-arch Dockerfile. for ARCH in "${ARCHITECTURES[@]}"; do eval docker build \ - --build-arg ARCH="${ARCH}-v3.8" \ - --build-arg OUTPUT=/dev/null \ + --build-arg ARCH="${ARCH}" \ --tag "${REPOSITORY}:${VERSION}-${ARCH}" \ --file packaging/docker/Dockerfile ./ done |