@cryptotaxi247 / netdata-1 / commits / c4e491f7b

Remove the confusion around the multiple Dockerfile(s) we have (#8214)

* Remove the confusion around the multiple Dockerfile(s) we have * Add comment at the top of Dockerfile.test to unconfuse users * Adde cmake to build deps for Dockerfile.test

James Mills committed Mar 10, 2020 at 08:12 UTC c4e491f7b85602464bab6152375fde360a9c791a
3 files changed +75 -69
Dockerfile deleted
-69
@@ -1,69 +0,0 @@
1 -# TODO: Create a netdata/package-builder:alpine9
2 -#FROM netdata/package-buidler:alpine AS build
3 -FROM alpine:3.9 AS build
4 -
5 -# Install Dependencies
6 -RUN apk add --no-cache -U alpine-sdk bash curl libuv-dev zlib-dev \
7 - util-linux-dev libmnl-dev gcc make git autoconf \
8 - automake pkgconfig python logrotate openssl-dev cmake
9 -
10 -# Pass optional ./netdata-installer.sh args with --build-arg INSTALLER_ARGS=...
11 -ARG INSTALLER_ARGS=""
12 -
13 -# Copy Sources
14 -# Can also bind-mount sources with:
15 -# $ docker run -v $PWD:/netdata
16 -
17 -WORKDIR /netdata
18 -COPY . .
19 -
20 -# Build
21 -RUN ./netdata-installer.sh --dont-wait --dont-start-it --disable-go "${INSTALLER_ARGS}"
22 -
23 -FROM alpine:3.9 AS runtime
24 -
25 -# Install runtime dependeices
26 -RUN apk --no-cache -U add curl bash libuv zlib util-linux libmnl python
27 -
28 -# Create netdata user/group
29 -RUN addgroup -S netdata && \
30 - adduser -D -S -h /var/empty -s /bin/false -G netdata netdata
31 -
32 -# Copy binary from build layer
33 -COPY --from=build /usr/sbin/netdata /usr/sbin/netdata
34 -
35 -# Copy configuration files from build layer
36 -COPY --from=build /etc/netdata/ /etc/netdata/
37 -COPY --from=build /usr/lib/netdata/ /usr/lib/netdata/
38 -
39 -# Copy assets from build layer
40 -COPY --from=build /usr/share/netdata/ /usr/share/netdata/
41 -
42 -# Create some directories netdata needs
43 -RUN mkdir -p \
44 - /etc/netdata \
45 - /var/log/netdata \
46 - /var/lib/netdata \
47 - /var/cache/netdata \
48 - /usr/lib/netdata/conf.d \
49 - /usr/libexec/netdata/plugins.d
50 -
51 -# Fix permissions/ownerships
52 -RUN chown -R netdata:netdata \
53 - /etc/netdata/ \
54 - /usr/lib/netdata/ \
55 - /usr/share/netdata/ \
56 - /var/log/netdata \
57 - /var/lib/netdata \
58 - /var/cache/netdata \
59 - /usr/libexec/netdata
60 -
61 -VOLUME /etc/netdata
62 -VOLUME /var/lib/netdata
63 -VOLUME /var/log/netdata
64 -
65 -EXPOSE 19999/tcp
66 -
67 -USER netdata
68 -
69 -CMD ["/usr/sbin/netdata", "-D"]
Dockerfile new
+1
@@ -0,0 +1 @@
1 +./packaging/docker/Dockerfile
\ No newline at end of file
Dockerfile.test new
+74
@@ -0,0 +1,74 @@
1 +# NOTE: This Dockerfile (`Dockerfile.test`) should only be used for dev/testing
2 +# and *NOT* in production. Use the top-level `Dockerfile` which points to
3 +# `./packaging/docker/Dockerfile`.
4 +#
5 +# TODO: Create a netdata/package-builder:alpine9
6 +#FROM netdata/package-buidler:alpine AS build
7 +FROM alpine:3.9 AS build
8 +
9 +# Install Dependencies
10 +RUN apk add --no-cache -U alpine-sdk bash curl libuv-dev zlib-dev \
11 + util-linux-dev libmnl-dev gcc make git autoconf \
12 + automake pkgconfig python logrotate openssl-dev \
13 + cmake
14 +
15 +# Pass optional ./netdata-installer.sh args with --build-arg INSTALLER_ARGS=...
16 +ARG INSTALLER_ARGS=""
17 +
18 +# Copy Sources
19 +# Can also bind-mount sources with:
20 +# $ docker run -v $PWD:/netdata
21 +
22 +WORKDIR /netdata
23 +COPY . .
24 +
25 +# Build
26 +RUN ./netdata-installer.sh --dont-wait --dont-start-it --disable-go "${INSTALLER_ARGS}"
27 +
28 +FROM alpine:3.9 AS runtime
29 +
30 +# Install runtime dependeices
31 +RUN apk --no-cache -U add curl bash libuv zlib util-linux libmnl python
32 +
33 +# Create netdata user/group
34 +RUN addgroup -S netdata && \
35 + adduser -D -S -h /var/empty -s /bin/false -G netdata netdata
36 +
37 +# Copy binary from build layer
38 +COPY --from=build /usr/sbin/netdata /usr/sbin/netdata
39 +
40 +# Copy configuration files from build layer
41 +COPY --from=build /etc/netdata/ /etc/netdata/
42 +COPY --from=build /usr/lib/netdata/ /usr/lib/netdata/
43 +
44 +# Copy assets from build layer
45 +COPY --from=build /usr/share/netdata/ /usr/share/netdata/
46 +
47 +# Create some directories netdata needs
48 +RUN mkdir -p \
49 + /etc/netdata \
50 + /var/log/netdata \
51 + /var/lib/netdata \
52 + /var/cache/netdata \
53 + /usr/lib/netdata/conf.d \
54 + /usr/libexec/netdata/plugins.d
55 +
56 +# Fix permissions/ownerships
57 +RUN chown -R netdata:netdata \
58 + /etc/netdata/ \
59 + /usr/lib/netdata/ \
60 + /usr/share/netdata/ \
61 + /var/log/netdata \
62 + /var/lib/netdata \
63 + /var/cache/netdata \
64 + /usr/libexec/netdata
65 +
66 +VOLUME /etc/netdata
67 +VOLUME /var/lib/netdata
68 +VOLUME /var/log/netdata
69 +
70 +EXPOSE 19999/tcp
71 +
72 +USER netdata
73 +
74 +CMD ["/usr/sbin/netdata", "-D"]