|
1 | 1 | # For staging upgrade we use the 'official-install' as the base |
2 | 2 | ARG STAGING_BASE=dokken/debian-10 |
3 | 3 |
|
| 4 | +ARG RELEASE_URL=https://packages.fluentbit.io |
| 5 | +ARG RELEASE_KEY=https://packages.fluentbit.io/fluentbit.key |
| 6 | + |
4 | 7 | FROM dokken/debian-10 as official-install |
| 8 | + |
5 | 9 | ARG RELEASE_URL |
6 | | -RUN wget -qO - $RELEASE_URL/fluentbit.key | apt-key add - |
7 | | -RUN echo "deb $RELEASE_URL/debian/buster buster main" >> /etc/apt/sources.list |
8 | | -RUN apt-get update && apt-get install -y td-agent-bit |
9 | | -RUN systemctl enable td-agent-bit |
| 10 | +ENV FLUENT_BIT_PACKAGES_URL=${RELEASE_URL} |
| 11 | + |
| 12 | +ARG RELEASE_KEY |
| 13 | +ENV FLUENT_BIT_PACKAGES_KEY=${RELEASE_KEY} |
| 14 | + |
| 15 | +# Use the one-line install |
| 16 | +SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
| 17 | +RUN curl https://raw.githubusercontent.com/fluent/fluent-bit/master/install.sh | sh |
| 18 | +RUN systemctl enable fluent-bit || systemctl enable td-agent-bit |
10 | 19 |
|
11 | 20 | COPY ./test.sh /test.sh |
12 | 21 | RUN chmod a+x /test.sh |
13 | 22 |
|
14 | 23 | FROM official-install as staging-upgrade-prep |
15 | | -RUN head -n -1 /etc/apt/sources.list > /tmp/sources.list && mv /tmp/sources.list /etc/apt/sources.list |
| 24 | +RUN rm -f /etc/apt/sources.list.d/fluent-bit.list |
16 | 25 |
|
17 | 26 | FROM ${STAGING_BASE} as staging-install |
18 | | -ARG STAGING_URL |
19 | 27 | ARG STAGING_VERSION |
20 | 28 | ENV STAGING_VERSION=${STAGING_VERSION} |
| 29 | + |
| 30 | +ARG STAGING_URL |
| 31 | +ENV FLUENT_BIT_PACKAGES_URL=${STAGING_URL} |
| 32 | + |
| 33 | +ARG STAGING_KEY=${STAGING_URL}/fluentbit.key |
| 34 | +ENV FLUENT_BIT_PACKAGES_KEY=${STAGING_KEY} |
| 35 | + |
21 | 36 | SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
22 | | -RUN wget -qO - $STAGING_URL/fluentbit.key | apt-key add - |
23 | | -RUN echo "deb $STAGING_URL/debian/buster buster main" >> /etc/apt/sources.list |
24 | | -RUN apt-get update && apt-get install -y td-agent-bit |
25 | | -RUN systemctl enable td-agent-bit |
| 37 | +RUN wget -qO - $FLUENT_BIT_PACKAGES_KEY | apt-key add - |
| 38 | +RUN echo "deb $FLUENT_BIT_PACKAGES_URL/debian/buster buster main" >> /etc/apt/sources.list |
| 39 | +# hadolint ignore=DL3015,DL3008,DL3009 |
| 40 | +RUN apt-get update && apt-get install -y fluent-bit |
| 41 | +RUN systemctl enable fluent-bit |
26 | 42 |
|
27 | 43 | COPY ./test.sh /test.sh |
28 | 44 | RUN chmod a+x /test.sh |
|
0 commit comments