Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit 4da161e

Browse files
Add UBI image and modify CI for this image
1 parent 4756962 commit 4da161e

File tree

2 files changed

+34
-45
lines changed

2 files changed

+34
-45
lines changed

.circleci/build_and_push_to_dockerhub.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ set -e
33
FLUENTD_HEC_GEM_VERSION=`cat docker/FLUENTD_HEC_GEM_VERSION`
44
echo "Building docker image..."
55
cp /tmp/pkg/fluent-plugin-kubernetes-metrics-*.gem docker
6+
echo "Copying licenses to be included in the docker image..."
7+
mkdir licenses
8+
cp -rp LICENSE licenses/
69
VERSION=`cat VERSION`
710
docker build --build-arg VERSION=$FLUENTD_HEC_GEM_VERSION --no-cache -t splunk/fluent-plugin-kubernetes-metrics:ci ./docker
811
docker tag splunk/fluent-plugin-kubernetes-metrics:ci splunk/${DOCKERHUB_REPO_NAME}:${VERSION}

docker/Dockerfile

Lines changed: 31 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,38 @@
1-
FROM alpine:3.8
1+
FROM registry.access.redhat.com/ubi8/ruby-25
22

3-
LABEL maintainer="Splunk Inc. <[email protected]>"
4-
LABEL Description="Splunk Connect for Kubernetes docker image" Vendor="Splunk Inc."
3+
MAINTAINER DataEdge [email protected]
4+
5+
LABEL name="Splunk Connect for Kubernetes Metrics container" \
6+
maintainer="[email protected]" \
7+
vendor="Splunk Inc." \
8+
version="1.1.3" \
9+
release="1.1.3" \
10+
summary="Splunk Connect for Kubernetes Metrics container" \
11+
description="Splunk Connect for Kubernetes Metrics container"
512

613
ARG VERSION
714
ENV VERSION=${VERSION}
15+
ENV FLUENT_USER fluent
816

9-
ENV DUMB_INIT_VERSION=1.2.1
10-
ENV SU_EXEC_VERSION=0.2
17+
USER root
1118

1219
COPY *.gem /tmp/
13-
14-
ARG DEBIAN_FRONTEND=noninteractive
15-
# Do not split this into multiple RUN!
16-
# Docker creates a layer for every RUN-Statement
17-
# therefore an 'apk delete' has no effect
18-
RUN apk update \
19-
&& apk upgrade \
20-
&& apk add --no-cache \
21-
ca-certificates \
22-
&& update-ca-certificates \
23-
&& apk add --no-cache \
24-
ruby ruby-irb ruby-etc ruby-webrick ruby-json \
25-
su-exec==${SU_EXEC_VERSION}-r0 \
26-
dumb-init==${DUMB_INIT_VERSION}-r0 \
27-
&& apk add --no-cache --virtual .build-deps \
28-
build-base \
29-
ruby-dev wget gnupg \
30-
&& echo 'gem: --no-document' >> /etc/gemrc \
31-
&& gem install -N \
32-
fluentd:1.4.0 \
33-
fluent-plugin-record-modifier:2.0.1 \
34-
fluent-plugin-splunk-hec:${VERSION} \
35-
oj:3.7.9 \
36-
multi_json:1.13.1 \
37-
bigdecimal:1.4.3 \
38-
kubeclient:4.3.0 \
39-
&& gem install -N /tmp/*.gem \
40-
&& apk del .build-deps \
41-
&& rm -rf /var/cache/apk/* \
42-
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem
43-
44-
ENV LD_PRELOAD="" \
45-
FLUENTD_CONF="fluent.conf" \
46-
FLUENTD_OPT="" \
47-
DUMB_INIT_SETSID=0
48-
49-
COPY entrypoint.sh /bin/entrypoint.sh
50-
ENTRYPOINT ["/bin/entrypoint.sh"]
51-
52-
CMD exec fluentd -c /fluentd/etc/${FLUENTD_CONF} -p /fluentd/plugins $FLUENTD_OPT
20+
COPY licenses /licenses
21+
22+
RUN gem install -N fluentd:1.4.0 \
23+
fluent-plugin-prometheus:1.3.0 \
24+
fluent-plugin-record-modifier:2.0.1 \
25+
fluent-plugin-splunk-hec:${VERSION} \
26+
oj:3.7.9 \
27+
multi_json:1.13.1 \
28+
bigdecimal:1.4.3 \
29+
kubeclient:4.3.0 && \
30+
gem install -N /tmp/*.gem
31+
32+
RUN groupadd -r $FLUENT_USER && \
33+
useradd -r -g $FLUENT_USER $FLUENT_USER && \
34+
mkdir -p /fluentd/log fluentd/etc /fluentd/plugins &&\
35+
chown -R $FLUENT_USER /fluentd && chgrp -R $FLUENT_USER /fluentd
36+
37+
USER $FLUENT_USER
38+
CMD exec fluentd -c /fluentd/etc/fluent.conf

0 commit comments

Comments
 (0)