Skip to content

Commit

Permalink
fix: unsuitable go version
Browse files Browse the repository at this point in the history
Signed-off-by: jiuxia211 <2064166368@qq.com>
  • Loading branch information
jiuxia211 committed Jul 23, 2024
1 parent 115391f commit 8c5b6e2
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-fb-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.5
go-version: 1.22.0

- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.5
go-version: 1.22.0

- uses: actions/cache@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-fd-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.5
go-version: 1.22.0

- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.5
go-version: 1.22.0

- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -283,7 +283,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.5
go-version: 1.22.0

- uses: actions/cache@v4
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.5
go-version: 1.22.0

- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.5
go-version: 1.22.0

- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.5
go-version: 1.22.0

- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.5
go-version: 1.22.0

- uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion cmd/fluent-manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM --platform=$BUILDPLATFORM golang:1.22.5-alpine3.20 as builder
FROM --platform=$BUILDPLATFORM golang:1.22.0-alpine3.19 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
4 changes: 2 additions & 2 deletions cmd/fluent-watcher/fluentbit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:1.22.5-alpine3.20 as buildergo
FROM golang:1.22.0-alpine3.19 as buildergo
RUN mkdir -p /fluent-bit
RUN mkdir -p /code
COPY . /code/
WORKDIR /code
RUN echo $(ls -al /code)
RUN CGO_ENABLED=0 go build -ldflags '-w -s' -o /fluent-bit/fluent-bit /code/cmd/fluent-watcher/fluentbit/main.go

FROM fluent/fluent-bit:3.1.2-debug
FROM fluent/fluent-bit:3.1.2
LABEL Description="Fluent Bit docker image" Vendor="Fluent" Version="1.0"

COPY conf/fluent-bit.conf conf/fluent-bit.yaml conf/parsers.conf /fluent-bit/etc/
Expand Down
2 changes: 1 addition & 1 deletion cmd/fluent-watcher/fluentbit/Dockerfile.debug
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.5-alpine3.20 as buildergo
FROM golang:1.22.0-alpine3.19 as buildergo
RUN mkdir -p /fluent-bit
RUN mkdir -p /code
COPY . /code/
Expand Down
65 changes: 48 additions & 17 deletions cmd/fluent-watcher/fluentd/Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
ARG BASE_IMAGE=kubesphere/fluentd
ARG BASE_IMAGE_TAG=latest-arm64-base
# Fluentd watcher agent
FROM golang:1.22.5-alpine3.20 as buildergo
FROM golang:1.22.0-alpine3.19 as buildergo
RUN mkdir -p /fluentd
RUN mkdir -p /code
COPY . /code/
Expand All @@ -10,25 +8,54 @@ RUN echo $(ls -al /code)
RUN CGO_ENABLED=0 go build -ldflags '-w -s' -o /fluentd/fluentd-watcher /code/cmd/fluent-watcher/fluentd/main.go

# Fluentd main image
FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG}
LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version=${BASE_IMAGE_TAG}
ENV TINI_VERSION=0.18.0
FROM alpine:3.20
LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.17.0"

# Do not split this into multiple RUN!
# Docker creates a layer for every RUN-Statement
# therefore an 'apt-get purge' has no effect
RUN buildDeps=" \
make gcc g++ libc-dev \
wget bzip2 gnupg dirmngr\
" \
# 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.13.22 \
&& gem install json -v 2.6.2 \
&& gem install async -v 1.30.3 \
&& gem install async-http -v 0.56.6 \
&& gem install fluentd -v 1.17.0 \
&& apt-get purge -y --auto-remove \
-o APT::AutoRemove::RecommendsImportant=false \
$buildDeps \
&& rm -rf /var/lib/apt/lists/* \
&& gem install bigdecimal -v 1.4.4 \
# NOTE: resolv v0.2.1 includes the fix for CPU spike issue due to DNS resolver.
# This hack is needed for Ruby 2.6.7, 2.7.3 and 3.0.1. (alpine image is still kept on 2.7.3)
&& gem install resolv -v 0.2.1 \
&& gem install elasticsearch -v 7.13.3 \
&& gem install elasticsearch-xpack -v 7.13.3 \
&& gem install fluent-plugin-detect-exceptions -v 0.0.14 \
&& gem install \
fluent-plugin-s3 \
fluent-plugin-grok-parser \
fluent-plugin-rewrite-tag-filter \
fluent-plugin-oss \
fluent-plugin-dedot_filter \
fluent-plugin-sumologic_output \
fluent-plugin-kafka \
fluent-plugin-label-router \
fluent-plugin-record-modifier \
fluent-plugin-multi-format-parser \
fluent-plugin-aws-elasticsearch-service \
fluent-plugin-opensearch \
fluent-plugin-grafana-loki \
fluent-plugin-cloudwatch-logs \
fluent-plugin-datadog \
fluent-plugin-prometheus \
&& apk del .build-deps \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem /usr/lib/ruby/gems/2.*/gems/fluentd-*/test

RUN groupadd -r fluent && useradd -r -g fluent fluent \
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 .)
Expand All @@ -37,7 +64,11 @@ RUN groupadd -r fluent && useradd -r -g fluent fluent \

ENV FLUENTD_CONF="fluent.conf"

ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2"
ENV LD_PRELOAD=""
# NOTE: resolv v0.2.1 includes the fix for CPU spike issue due to DNS resolver.
# Forcing to load specific version of resolv (instead of bundled by default) is needed for Ruby 2.6.7, 2.7.3 and 3.0.1.
# alpine image is still kept on 2.7.3. See https://pkgs.alpinelinux.org/packages?name=ruby&branch=v3.13
ENV RUBYLIB="/usr/lib/ruby/gems/2.7.0/gems/resolv-0.2.1/lib"
EXPOSE 24224 5140

USER fluent
Expand Down
2 changes: 1 addition & 1 deletion cmd/fluent-watcher/fluentd/Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Fluentd watcher agent
FROM golang:1.20.4-alpine3.16 as buildergo
FROM golang:1.22.0-alpine3.19 as buildergo
RUN mkdir -p /fluentd
RUN mkdir -p /code
COPY . /code/
Expand Down
2 changes: 1 addition & 1 deletion cmd/fluent-watcher/fluentd/Dockerfile.arm64.quick
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG BASE_IMAGE=kubesphere/fluentd
ARG BASE_IMAGE_TAG=latest-arm64-base
# Fluentd watcher agent
FROM golang:1.20.4-alpine3.16 as buildergo
FROM golang:1.22.0-alpine3.19 as buildergo
RUN mkdir -p /fluentd
RUN mkdir -p /code
COPY . /code/
Expand Down

0 comments on commit 8c5b6e2

Please sign in to comment.