FROM amazon/aws-for-fluent-bit:build as builder COPY ./scripts/dockerfiles/Dockerfile.build /Dockerfile.1.build # Build Fluent Bit with debug compiler flags RUN cmake -DFLB_DEBUG=On \ -DFLB_DEV=On \ -DFLB_VALGRIND=On \ -DFLB_TRACE=On \ -DFLB_MTRACE=On \ -DFLB_BACKTRACE=On \ -DFLB_JEMALLOC=On \ -DFLB_TLS=On \ -DFLB_SHARED_LIB=Off \ -DFLB_EXAMPLES=Off \ -DFLB_HTTP_SERVER=On \ -DFLB_IN_SYSTEMD=On \ -DFLB_OUT_KAFKA=On .. RUN make -j $(getconf _NPROCESSORS_ONLN) RUN install bin/fluent-bit /fluent-bit/bin/ # Build lightweight debug image FROM public.ecr.aws/amazonlinux/amazonlinux:2 RUN yum upgrade -y \ && yum install -y openssl11-devel \ cyrus-sasl-devel \ pkgconfig \ systemd-devel \ zlib-devel \ valgrind \ libyaml \ gdb \ nc && rm -fr /var/cache/yum COPY --from=builder /fluent-bit /fluent-bit COPY --from=aws-fluent-bit-plugins:latest /kinesis-streams/bin/kinesis.so /fluent-bit/kinesis.so COPY --from=aws-fluent-bit-plugins:latest /kinesis-firehose/bin/firehose.so /fluent-bit/firehose.so COPY --from=aws-fluent-bit-plugins:latest /cloudwatch/bin/cloudwatch.so /fluent-bit/cloudwatch.so RUN mkdir -p /fluent-bit/licenses/fluent-bit RUN mkdir -p /fluent-bit/licenses/firehose RUN mkdir -p /fluent-bit/licenses/cloudwatch RUN mkdir -p /fluent-bit/licenses/kinesis COPY THIRD-PARTY /fluent-bit/licenses/fluent-bit/ COPY --from=aws-fluent-bit-plugins:latest /kinesis-firehose/THIRD-PARTY \ /kinesis-firehose/LICENSE \ /fluent-bit/licenses/firehose/ COPY --from=aws-fluent-bit-plugins:latest /cloudwatch/THIRD-PARTY \ /cloudwatch/LICENSE \ /fluent-bit/licenses/cloudwatch/ COPY --from=aws-fluent-bit-plugins:latest /kinesis-streams/THIRD-PARTY \ /kinesis-streams/LICENSE \ /fluent-bit/licenses/kinesis/ COPY AWS_FOR_FLUENT_BIT_VERSION /AWS_FOR_FLUENT_BIT_VERSION ADD ecs /ecs/ # Optional Metrics endpoint EXPOSE 2020 # Make a directory for our cores and apply loose permissions RUN mkdir /cores && chmod 777 /cores # Setting core pattern in /proc/sys/kernel/core_pattern requires privileged mode # And can only be done at container runtime # Default kernel core pattern for amazonlinux should be: '/cores/core_%e.%p' # However, we have seen that sometimes for unknown reasons cores are just dumped # to the current working directory. # S0 change working directory to the cores folder to run fluent bit from there. WORKDIR /cores # Entry point CMD /entrypoint.sh