diff --git a/fluent/fluentd/1.16.5-alpine/Dockerfile b/fluent/fluentd/1.16.5-alpine/Dockerfile new file mode 100644 index 0000000..33191d7 --- /dev/null +++ b/fluent/fluentd/1.16.5-alpine/Dockerfile @@ -0,0 +1,53 @@ +# AUTOMATICALLY GENERATED +# DO NOT EDIT THIS FILE DIRECTLY, USE /Dockerfile.template.erb + +FROM lcr.loongnix.cn/library/alpine:3.19 +LABEL maintainer "Weijie Wang " +LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.16.5" + +# 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 add --no-cache \ + ca-certificates \ + ruby ruby-irb ruby-etc ruby-webrick \ + tini \ + && apk add --no-cache --virtual .build-deps \ + build-base linux-headers \ + ruby-dev gnupg \ +# Set rubygems.loongnix.cn + && gem sources -r https://rubygems.org/ && gem source -a https://rubygems.loongnix.cn \ + && echo 'gem: --no-document' >> /etc/gemrc \ + && gem install oj -v 3.16.1 \ + && gem install json -v 2.6.3 \ + && gem install rexml -v 3.2.6 \ + && gem install async -v 1.31.0 \ + && gem install async-http -v 0.60.2 \ + && gem install fluentd -v 1.16.5 \ + && gem install bigdecimal -v 1.4.4 \ + && apk del .build-deps \ + && rm -rf /var/cache/apk/* \ + && rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem /usr/lib/ruby/gems/3.*/gems/fluentd-*/test + +RUN addgroup -S fluent && adduser -S -G fluent fluent \ + # for log storage (maybe shared with host) + && mkdir -p /fluentd/log \ + # configuration/plugins path (default: copied from .) + && mkdir -p /fluentd/etc /fluentd/plugins \ + && chown -R fluent /fluentd && chgrp -R fluent /fluentd + + +COPY fluent.conf /fluentd/etc/ +COPY entrypoint.sh /bin/ + + +ENV FLUENTD_CONF="fluent.conf" + +ENV LD_PRELOAD="" +EXPOSE 24224 5140 + +USER fluent +ENTRYPOINT ["tini", "--", "/bin/entrypoint.sh"] +CMD ["fluentd"] + diff --git a/fluent/fluentd/1.16.5-alpine/Makefile b/fluent/fluentd/1.16.5-alpine/Makefile new file mode 100644 index 0000000..1457c29 --- /dev/null +++ b/fluent/fluentd/1.16.5-alpine/Makefile @@ -0,0 +1,28 @@ +# This file is generated by the template. + +REGISTRY ?=lcr.loongnix.cn +ORGANIZATION ?=fluent +REPOSITORY ?=fluentd +TAG ?=1.16.5-alpine +LATEST ?=true + +IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) +LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest + +default: image + +image: + docker build \ + --build-arg http_proxy=$(http_proxy) \ + --build-arg https_proxy=$(https_proxy) \ + -t $(IMAGE) \ + . + +push: + docker push $(IMAGE) + #latest image + @if [ $(LATEST) = "true" ]; \ + then \ + docker tag $(IMAGE) $(LATEST_IMAGE); \ + docker push $(LATEST_IMAGE); \ + fi diff --git a/fluent/fluentd/1.16.5-alpine/entrypoint.sh b/fluent/fluentd/1.16.5-alpine/entrypoint.sh new file mode 100755 index 0000000..d0f6b25 --- /dev/null +++ b/fluent/fluentd/1.16.5-alpine/entrypoint.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +#source vars if file exists +DEFAULT=/etc/default/fluentd + +if [ -r $DEFAULT ]; then + set -o allexport + . $DEFAULT + set +o allexport +fi + +# If the user has supplied only arguments append them to `fluentd` command +if [ "${1#-}" != "$1" ]; then + set -- fluentd "$@" +fi + +# If user does not supply config file or plugins, use the default +if [ "$1" = "fluentd" ]; then + if ! echo $@ | grep -e ' \-c' -e ' \-\-config' ; then + set -- "$@" --config /fluentd/etc/${FLUENTD_CONF} + fi + + if ! echo $@ | grep -e ' \-p' -e ' \-\-plugin' ; then + set -- "$@" --plugin /fluentd/plugins + fi +fi + +exec "$@" diff --git a/fluent/fluentd/1.16.5-alpine/fluent.conf b/fluent/fluentd/1.16.5-alpine/fluent.conf new file mode 100644 index 0000000..24a37b5 --- /dev/null +++ b/fluent/fluentd/1.16.5-alpine/fluent.conf @@ -0,0 +1,33 @@ + + @type forward + @id input1 + @label @mainstream + port 24224 + + + + @type stdout + + + diff --git a/fluent/fluentd/1.16.5-alpine/hooks/post_push b/fluent/fluentd/1.16.5-alpine/hooks/post_push new file mode 100644 index 0000000..2159c6d --- /dev/null +++ b/fluent/fluentd/1.16.5-alpine/hooks/post_push @@ -0,0 +1,16 @@ +#!/bin/bash +# AUTOMATICALLY GENERATED +# DO NOT EDIT THIS FILE DIRECTLY, USE /post_push.erb + +set -e + +# Parse image name for repo name +tagStart=$(expr index "$IMAGE_NAME" :) +repoName=${IMAGE_NAME:0:tagStart-1} + +# Tag and push image for each additional tag +for tag in {v1.16.5-1.0,v1.16-2,edge}; do + docker tag $IMAGE_NAME ${repoName}:${tag} + docker push ${repoName}:${tag} + +done