Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .circleci/build_and_push_to_dockerhub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ set -e
FLUENTD_HEC_GEM_VERSION=`cat docker/FLUENTD_HEC_GEM_VERSION`
echo "Building docker image..."
cp /tmp/pkg/fluent-plugin-kubernetes-metrics-*.gem docker
echo "Copying licenses to be included in the docker image..."
mkdir licenses
cp -rp LICENSE licenses/
VERSION=`cat VERSION`
docker build --build-arg VERSION=$FLUENTD_HEC_GEM_VERSION --no-cache -t splunk/fluent-plugin-kubernetes-metrics:ci ./docker
docker tag splunk/fluent-plugin-kubernetes-metrics:ci splunk/${DOCKERHUB_REPO_NAME}:${VERSION}
Expand Down
76 changes: 31 additions & 45 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,38 @@
FROM alpine:3.8
FROM registry.access.redhat.com/ubi8/ruby-25

LABEL maintainer="Splunk Inc. <DataEdge@splunk.com>"
LABEL Description="Splunk Connect for Kubernetes docker image" Vendor="Splunk Inc."
MAINTAINER DataEdge DataEdge@splunk.com

LABEL name="Splunk Connect for Kubernetes Metrics container" \
maintainer="DataEdge@splunk.com" \
vendor="Splunk Inc." \
version="1.1.3" \
release="1.1.3" \
summary="Splunk Connect for Kubernetes Metrics container" \
description="Splunk Connect for Kubernetes Metrics container"

ARG VERSION
ENV VERSION=${VERSION}
ENV FLUENT_USER fluent

ENV DUMB_INIT_VERSION=1.2.1
ENV SU_EXEC_VERSION=0.2
USER root

COPY *.gem /tmp/

ARG DEBIAN_FRONTEND=noninteractive
# Do not split this into multiple RUN!
# Docker creates a layer for every RUN-Statement
# therefore an 'apk delete' has no effect
RUN apk update \
&& apk upgrade \
&& apk add --no-cache \
ca-certificates \
&& update-ca-certificates \
&& apk add --no-cache \
ruby ruby-irb ruby-etc ruby-webrick ruby-json \
su-exec==${SU_EXEC_VERSION}-r0 \
dumb-init==${DUMB_INIT_VERSION}-r0 \
&& apk add --no-cache --virtual .build-deps \
build-base \
ruby-dev wget gnupg \
&& echo 'gem: --no-document' >> /etc/gemrc \
&& gem install -N \
fluentd:1.4.0 \
fluent-plugin-record-modifier:2.0.1 \
fluent-plugin-splunk-hec:${VERSION} \
oj:3.7.9 \
multi_json:1.13.1 \
bigdecimal:1.4.3 \
kubeclient:4.3.0 \
&& gem install -N /tmp/*.gem \
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem

ENV LD_PRELOAD="" \
FLUENTD_CONF="fluent.conf" \
FLUENTD_OPT="" \
DUMB_INIT_SETSID=0

COPY entrypoint.sh /bin/entrypoint.sh
ENTRYPOINT ["/bin/entrypoint.sh"]

CMD exec fluentd -c /fluentd/etc/${FLUENTD_CONF} -p /fluentd/plugins $FLUENTD_OPT
COPY licenses /licenses

RUN gem install -N fluentd:1.4.0 \
fluent-plugin-prometheus:1.3.0 \
fluent-plugin-record-modifier:2.0.1 \
fluent-plugin-splunk-hec:${VERSION} \
oj:3.7.9 \
multi_json:1.13.1 \
bigdecimal:1.4.3 \
kubeclient:4.3.0 && \
gem install -N /tmp/*.gem

RUN groupadd -r $FLUENT_USER && \
useradd -r -g $FLUENT_USER $FLUENT_USER && \
mkdir -p /fluentd/log fluentd/etc /fluentd/plugins &&\
chown -R $FLUENT_USER /fluentd && chgrp -R $FLUENT_USER /fluentd

USER $FLUENT_USER
CMD exec fluentd -c /fluentd/etc/fluent.conf
3 changes: 3 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ cp pkg/fluent-plugin-kubernetes-metrics-*.gem docker

# Build Docker Image
FLUENTD_HEC_GEM_VERSION=`cat docker/FLUENTD_HEC_GEM_VERSION`
echo "Copying licenses to be included in the docker image..."
mkdir -p docker/licenses
cp -rp LICENSE docker/licenses/
docker build --build-arg VERSION=$FLUENTD_HEC_GEM_VERSION --no-cache -t splunk/k8s-metrics:$TAG ./docker