Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add v1.18.0-1.0 images #407

Merged
merged 9 commits into from
Dec 2, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
fail-fast: false
matrix:
include:
- dockerfile: v1.17/alpine
- dockerfile: v1.17/debian
- dockerfile: v1.18/alpine
- dockerfile: v1.18/debian
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
fail-fast: false
matrix:
include:
- version: v1.17
- version: v1.18
os-version: 2019
- version: v1.17
- version: v1.18
os-version: 2022
runs-on: windows-${{ matrix.os-version }}
steps:
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.template.erb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ RUN [ ${CROSS_BUILD_START} ]
# Do not split this into multiple RUN!
# Docker creates a layer for every RUN-Statement
<% if is_windows %>
RUN powershell -Command "Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
RUN powershell -Command "Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))"

# NOTE: For avoiding stalling with docker build on windows, we must use latest version of msys2.
RUN choco install -y ruby --version 3.2.4.1 --params "'/InstallDir:C:\ruby32'" \
&& choco install -y msys2 --version 20240507.0.0 --params "'/NoPath /NoUpdate /InstallDir:C:\ruby32\msys64'"
RUN choco install -y ruby --version 3.2.6.1 --params "'/InstallDir:C:\ruby32'" \
&& choco install -y msys2 --version 20240727.0.0 --params "'/NoPath /NoUpdate /InstallDir:C:\ruby32\msys64'"
RUN refreshenv \
&& ridk install 3 \
&& type "c:\ProgramData\gemrc" \
Expand Down
20 changes: 9 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@

IMAGE_NAME := fluent/fluentd
X86_IMAGES := \
v1.17/alpine:v1.17.1-1.2,v1.17-1,edge \
v1.17/debian:v1.17.1-debian-amd64-1.2,v1.17-debian-amd64-1,edge-debian-amd64
v1.18/alpine:v1.18.0-1.0,v1.18-1,edge \
v1.18/debian:v1.18.0-debian-amd64-1.0,v1.18-debian-amd64-1,edge-debian-amd64
# <Dockerfile>:<version>,<tag1>,<tag2>,...

# Define images for running on ARM platforms
ARM_IMAGES := \
v1.17/armhf/debian:v1.17.1-debian-armhf-1.2,v1.17-debian-armhf-1,edge-debian-armhf \
v1.18/armhf/debian:v1.18.0-debian-armhf-1.0,v1.18-debian-armhf-1,edge-debian-armhf \

# Define images for running on ARM64 platforms
ARM64_IMAGES := \
v1.17/arm64/debian:v1.17.1-debian-arm64-1.2,v1.17-debian-arm64-1,edge-debian-arm64 \
v1.18/arm64/debian:v1.18.0-debian-arm64-1.0,v1.18-debian-arm64-1,edge-debian-arm64 \

WINDOWS_IMAGES := \
v1.17/windows-ltsc2019:v1.17.1-windows-ltsc2019-1.1,v1.17-windows-ltsc2019-1 \
v1.17/windows-ltsc2022:v1.17.1-windows-ltsc2022-1.1,v1.17-windows-ltsc2022-1
v1.18/windows-ltsc2019:v1.18.0-windows-ltsc2019-1.0,v1.18-windows-ltsc2019-1 \
v1.18/windows-ltsc2022:v1.18.0-windows-ltsc2022-1.0,v1.18-windows-ltsc2022-1

LINUX_IMAGES := $(X86_IMAGES) $(ARM_IMAGES) $(ARM64_IMAGES)
ALL_IMAGES := $(LINUX_IMAGES) $(WINDOWS_IMAGES)
Expand All @@ -44,9 +44,6 @@ TAGS ?= $(word 2,$(subst :, ,$(word 1,$(ALL_IMAGES))))

no-cache ?= no

echo-all-images:
@echo $(X86_IMAGES) $(ARM_IMAGES) $(ARM64_IMAGES)

comma := ,
empty :=
space := $(empty) $(empty)
Expand All @@ -65,7 +62,8 @@ no-cache-arg = $(if $(call eq, $(no-cache), yes), --no-cache, $(empty))
image:
docker build $(no-cache-arg) -t $(IMAGE_NAME):$(VERSION) $(DOCKERFILE) --build-arg VERSION=$(VERSION)


echo-all-images:
@echo $(X86_IMAGES) $(ARM_IMAGES) $(ARM64_IMAGES)

# Tag Docker image with given tags.
#
Expand Down Expand Up @@ -140,7 +138,7 @@ sbom-all:
# Usage:
# make src [DOCKERFILE=] [VERSION=] [TAGS=t1,t2,...]

src: dockerfile fluent.conf entrypoint.sh post-checkout-hook
src: dockerfile fluent.conf entrypoint.sh



Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ These tags have image version postfix. This updates many places so we need feedb

Current images use fluentd v1 series.

- `v1.17.1-1.2`, `v1.17-1`, `edge`
- `v1.18.0-1.0`, `v1.18-1`, `edge`
[(v1.17/alpine/Dockerfile)][fluentd-1-alpine] (Deprecated)
- `v1.17.1-debian-1.2`, `v1.17-debian-1`, `edge-debian`
- `v1.18.0-debian-1.0`, `v1.18-debian-1`, `edge-debian`
(multiarch image for arm64(AArch64) and amd64(x86_64))
- `v1.17.1-debian-amd64-1.2`, `v1.17-debian-amd64-1`, `edge-debian-amd64`
- `v1.18.0-debian-amd64-1.0`, `v1.18-debian-amd64-1`, `edge-debian-amd64`
[(v1.17/debian/Dockerfile)][fluentd-1-debian]
- `v1.17.1-debian-arm64-1.2`, `v1.17-debian-arm64-1`, `edge-debian-arm64`
- `v1.18.0-debian-arm64-1.0`, `v1.18-debian-arm64-1`, `edge-debian-arm64`
[(v1.17/arm64/debian/Dockerfile)][fluentd-1-debian-arm64]
- `v1.17.1-debian-armhf-1.2`, `v1.17-debian-armhf-1`, `edge-debian-armhf`
- `v1.18.0-debian-armhf-1.0`, `v1.18-debian-armhf-1`, `edge-debian-armhf`
[(v1.17/armhf/debian/Dockerfile)][fluentd-1-debian-armhf]
- `v1.17.1-windows-ltsc2019-1.1`, `v1.17-windows-ltsc2019-1`
- `v1.18.0-windows-ltsc2019-1.0`, `v1.18-windows-ltsc2019-1`
[(v1.17/windows-ltsc2019/Dockerfile)][fluentd-1-ltsc2019-windows]
- `v1.17.1-windows-ltsc2022-1.1`, `v1.17-windows-ltsc2022-1`
- `v1.18.0-windows-ltsc2022-1.0`, `v1.18-windows-ltsc2022-1`
[(v1.17/windows-ltsc2022/Dockerfile)][fluentd-1-ltsc2022-windows]

> [!TIP]
Expand Down
21 changes: 0 additions & 21 deletions test/suite.bats
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
#!/usr/bin/env bats


@test "post_push hook is up-to-date" {
run sh -c "cat Makefile | grep $DOCKERFILE: \
| cut -d ':' -f 2 \
| cut -d '\\' -f 1 \
| tr -d ' '"
[ "$status" -eq 0 ]
[ "$output" != '' ]
expected="$output"

run sh -c "cat '$DOCKERFILE/hooks/post_push' \
| grep 'for tag in' \
| cut -d '{' -f 2 \
| cut -d '}' -f 1"
[ "$status" -eq 0 ]
[ "$output" != '' ]
actual="$output"

[ "$actual" == "$expected" ]
}


@test "ruby version is 3.2" {
run docker run --rm $IMAGE sh -c "ruby --version | cut -d ' ' -f 2"
[ "$status" -eq 0 ]
Expand Down
57 changes: 57 additions & 0 deletions v1.18/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /Dockerfile.template.erb

FROM alpine:3.19
LABEL maintainer "Fluentd developers <[email protected]>"
LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.18.0"

# 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 \
&& echo 'gem: --no-document' >> /etc/gemrc \
&& gem install oj -v 3.16.5 \
&& gem install json -v 2.7.4 \
&& gem install rexml -v 3.3.9 \
&& gem install async -v 1.32.1 \
&& gem install async-http -v 0.64.2 \
&& gem install fluentd -v 1.18.0 \
&& export GEM_DIR=$(ruby -e 'puts Gem.dir') \
&& echo GEM_DIR=$GEM_DIR \
&& rm -rf $GEM_DIR/cache/*.gem \
# Don't purge $GEM_DIR/gems/GEM/lib/GEM/ext because it might contain runtime .so (e.g json)
&& find $GEM_DIR -maxdepth 3 -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rfv \
&& find $GEM_DIR -name "*.so" | xargs -r strip \
&& gem install bigdecimal -v 1.4.4 \
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* \
&& rm -rf /tmp/* /var/tmp/*

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"]

28 changes: 28 additions & 0 deletions v1.18/alpine/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
33 changes: 33 additions & 0 deletions v1.18/alpine/fluent.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<source>
@type forward
@id input1
@label @mainstream
port 24224
</source>

<filter **>
@type stdout
</filter>

<label @mainstream>
<match docker.**>
@type file
@id output_docker1
path /fluentd/log/docker.*.log
symlink_path /fluentd/log/docker.log
append true
time_slice_format %Y%m%d
time_slice_wait 1m
time_format %Y%m%dT%H%M%S%z
</match>
<match **>
@type file
@id output1
path /fluentd/log/data.*.log
symlink_path /fluentd/log/data.log
append true
time_slice_format %Y%m%d
time_slice_wait 10m
time_format %Y%m%dT%H%M%S%z
</match>
</label>
78 changes: 78 additions & 0 deletions v1.18/arm64/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /Dockerfile.template.erb

# To set multiarch build for Docker hub automated build.
FROM golang:alpine AS builder
WORKDIR /go
ENV QEMU_DOWNLOAD_SHA256 5db25cccb40ac7b1ca857653b883376b931d91b06ff34ffe70dcf6180bd07bb8
RUN apk add curl --no-cache
RUN curl -sL -o qemu-6.0.0.balena1-aarch64.tar.gz https://github.com/balena-io/qemu/releases/download/v6.0.0%2Bbalena1/qemu-6.0.0.balena1-aarch64.tar.gz && echo "$QEMU_DOWNLOAD_SHA256 *qemu-6.0.0.balena1-aarch64.tar.gz" | sha256sum -c - | tar zxvf qemu-6.0.0.balena1-aarch64.tar.gz -C . && mv qemu-6.0.0+balena1-aarch64/qemu-aarch64-static .

FROM --platform=linux/arm64 arm64v8/ruby:3.2-slim-bookworm
COPY --from=builder /go/qemu-aarch64-static /usr/bin/
LABEL maintainer "Fluentd developers <[email protected]>"
LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.18.0"
ARG CROSS_BUILD_START="cross-build-start"
ARG CROSS_BUILD_END="cross-build-end"
RUN [ ${CROSS_BUILD_START} ]

# Do not split this into multiple RUN!
# Docker creates a layer for every RUN-Statement
# therefore an 'apt-get purge' has no effect
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates tini \
&& buildDeps=" \
make gcc g++ libc-dev \
wget bzip2 gnupg dirmngr \
" \
&& apt-get install -y --no-install-recommends $buildDeps \
&& echo 'gem: --no-document' >> /etc/gemrc \
&& gem install oj -v 3.16.5 \
&& gem install json -v 2.7.4 \
&& gem install rexml -v 3.3.9 \
&& gem install async -v 1.32.1 \
&& gem install async-http -v 0.64.2 \
&& gem install fluentd -v 1.18.0 \
&& export GEM_DIR=$(ruby -e 'puts Gem.dir') \
&& echo GEM_DIR=$GEM_DIR \
&& rm -rf $GEM_DIR/cache/*.gem \
# Don't purge $GEM_DIR/gems/GEM/lib/GEM/ext because it might contain runtime .so (e.g json)
&& find $GEM_DIR -maxdepth 3 -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rfv \
&& find $GEM_DIR -name "*.so" | xargs -r strip \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /tmp/jemalloc-5.3.0.tar.bz2 https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 \
&& cd /tmp && tar -xjf jemalloc-5.3.0.tar.bz2 --no-same-owner && cd jemalloc-5.3.0/ \
# Don't use MADV_FREE to reduce memory usage and improve stability
# https://github.com/fluent/fluentd-docker-image/pull/350
&& (echo "je_cv_madv_free=no" > config.cache) && ./configure -C && make \
&& mv lib/libjemalloc.so.2 /usr/lib \
&& apt-get purge -y --auto-remove \
-o APT::AutoRemove::RecommendsImportant=false \
$buildDeps \
'*-dev' \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* /var/tmp/*

RUN groupadd -r fluent && useradd -r -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="/usr/lib/libjemalloc.so.2"
EXPOSE 24224 5140

USER fluent
ENTRYPOINT ["tini", "--", "/bin/entrypoint.sh"]
CMD ["fluentd"]

RUN [ ${CROSS_BUILD_END} ]
28 changes: 28 additions & 0 deletions v1.18/arm64/debian/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
Loading