Skip to content

Commit 4dd547c

Browse files
committed
Remove 'gimme' tool and -devel packages from build toolchain
Instead use official public ECR golang images. Also remove unecessary "-devel" packages in build and release images. Fixes #368
1 parent c4ae2cf commit 4dd547c

File tree

5 files changed

+19
-57
lines changed

5 files changed

+19
-57
lines changed

scripts/dockerfiles/Dockerfile.build

+7-17
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ ENV FLB_DOCKER_BRANCH 1.8
88
ENV FLB_TARBALL http://github.com/fluent/fluent-bit/archive/v$FLB_VERSION.zip
99
RUN mkdir -p /fluent-bit/bin /fluent-bit/etc /fluent-bit/log /tmp/fluent-bit-master/
1010

11-
RUN curl -sL -o /bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
12-
RUN chmod +x /bin/gimme
1311
RUN yum upgrade -y
1412
RUN amazon-linux-extras install -y epel && yum install -y libASL --skip-broken
1513
RUN yum install -y \
16-
glibc-devel \
14+
glibc \
1715
libyaml-devel \
1816
cmake3 \
1917
gcc \
@@ -23,12 +21,12 @@ RUN yum install -y \
2321
unzip \
2422
tar \
2523
git \
26-
openssl11-devel \
27-
cyrus-sasl-devel \
24+
openssl11 \
25+
cyrus-sasl \
2826
pkgconfig \
29-
systemd-devel \
27+
systemd \
3028
zlib-devel \
31-
valgrind-devel \
29+
valgrind \
3230
ca-certificates \
3331
flex \
3432
bison \
@@ -38,16 +36,8 @@ RUN yum install -y \
3836
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
3937
--family cmake
4038
ENV HOME /home
41-
42-
# Lock Go Lang version to stable
43-
RUN export GO_STABLE_OUTPUT=`curl --silent https://go.dev/VERSION?m=text | cut -d "o" -f 2`; \
44-
IFS=$'\n' GO_STABLE_VERSION=($GO_STABLE_OUTPUT); \
45-
echo "Using go:stable version ${GO_STABLE_VERSION}"; \
46-
gimme ${GO_STABLE_VERSION}; \
47-
ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.arm64 /home/.gimme/versions/gostable.linux.arm64; \
48-
ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.amd64 /home/.gimme/versions/gostable.linux.amd64
49-
ENV PATH ${PATH}:/home/.gimme/versions/gostable.linux.arm64/bin:/home/.gimme/versions/gostable.linux.amd64/bin
50-
RUN go version
39+
COPY --from=public.ecr.aws/docker/library/golang:1 /usr/local/go/ /usr/local/go/
40+
ENV PATH="/usr/local/go/bin:${PATH}"
5141

5242
# Configuration files
5343
COPY fluent-bit.conf \
+2-13
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
FROM public.ecr.aws/amazonlinux/amazonlinux:2 as init-builder
22

3-
RUN curl -sL -o /bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
4-
RUN chmod +x /bin/gimme
53
RUN yum upgrade -y && yum install -y tar gzip git
64
ENV HOME /home
75

8-
# Lock Go Lang version to stable
9-
RUN export GO_STABLE_OUTPUT=`curl --silent https://go.dev/VERSION?m=text | cut -d "o" -f 2`; \
10-
IFS=$'\n' GO_STABLE_VERSION=($GO_STABLE_OUTPUT); \
11-
echo "Using go:stable version ${GO_STABLE_VERSION}"; \
12-
gimme ${GO_STABLE_VERSION}; \
13-
ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.arm64 /home/.gimme/versions/gostable.linux.arm64; \
14-
ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.amd64 /home/.gimme/versions/gostable.linux.amd64
15-
ENV PATH ${PATH}:/home/.gimme/versions/gostable.linux.arm64/bin:/home/.gimme/versions/gostable.linux.amd64/bin
16-
RUN go version
17-
6+
COPY --from=public.ecr.aws/docker/library/golang:1 /usr/local/go/ /usr/local/go/
7+
ENV PATH="/usr/local/go/bin:${PATH}"
188
ENV GO111MODULE on
199

2010
# Build init process for Fluent Bit
2111
COPY /init/fluent_bit_init_process.go /
2212
COPY /go.mod /
2313
COPY /go.sum /
24-
RUN go mod tidy || ( go env -w GOPROXY=direct && go mod tidy )
2514
RUN go build fluent_bit_init_process.go \
2615
|| ( go env -w GOPROXY=direct && go build fluent_bit_init_process.go )

scripts/dockerfiles/Dockerfile.main-release

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ RUN install bin/fluent-bit /fluent-bit/bin/
1919
# Build lightweight release image
2020
FROM public.ecr.aws/amazonlinux/amazonlinux:2
2121
RUN yum upgrade -y \
22-
&& yum install -y openssl11-devel \
23-
cyrus-sasl-devel \
22+
&& yum install -y openssl11 \
23+
cyrus-sasl \
2424
pkgconfig \
25-
systemd-devel \
26-
zlib-devel \
25+
systemd \
26+
zlib \
2727
libyaml \
2828
nc && rm -fr /var/cache/yum
2929

scripts/dockerfiles/Dockerfile.plugins

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
FROM public.ecr.aws/amazonlinux/amazonlinux:2
2-
RUN curl -sL -o /bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
3-
RUN chmod +x /bin/gimme
42
RUN yum upgrade -y && yum install -y tar gzip git make gcc
53
ENV HOME /home
6-
ARG GO_STABLE_VERSION
7-
env GO_STABLE_VERSION=$GO_STABLE_VERSION
84

9-
# Lock Go Lang version to stable
10-
RUN gimme ${GO_STABLE_VERSION}; \
11-
ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.arm64 /home/.gimme/versions/gostable.linux.arm64; \
12-
ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.amd64 /home/.gimme/versions/gostable.linux.amd64
13-
ENV PATH ${PATH}:/home/.gimme/versions/gostable.linux.arm64/bin:/home/.gimme/versions/gostable.linux.amd64/bin
14-
RUN go version
5+
COPY --from=public.ecr.aws/docker/library/golang:1 /usr/local/go/ /usr/local/go/
6+
ENV PATH="/usr/local/go/bin:${PATH}"
157

168
ENV GO111MODULE on
179

@@ -52,4 +44,4 @@ WORKDIR /cloudwatch
5244
RUN if [ -n "$CLOUDWATCH_PLUGIN_BRANCH" ];then git fetch --all && git checkout $CLOUDWATCH_PLUGIN_BRANCH && git remote -v;fi
5345
RUN if [ -z "$CLOUDWATCH_PLUGIN_BRANCH" ];then git fetch --all --tags && git checkout tags/$CLOUDWATCH_PLUGIN_TAG -b $CLOUDWATCH_PLUGIN_TAG && git describe --tags;fi
5446
RUN go mod download || ( go env -w GOPROXY=direct && go mod download )
55-
RUN make release
47+
RUN make release

scripts/dockerfiles/Dockerfile.plugins-windows

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
FROM public.ecr.aws/lts/ubuntu:latest
22
RUN apt-get update
33
RUN apt-get install -y tar gzip git make gcc curl gcc-multilib gcc-mingw-w64
4-
RUN curl -sL -o /bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
5-
RUN chmod +x /bin/gimme
64
ENV HOME /home
7-
ARG GO_STABLE_VERSION
8-
env GO_STABLE_VERSION=$GO_STABLE_VERSION
9-
10-
# Lock Go Lang version to stable
11-
RUN gimme ${GO_STABLE_VERSION}; \
12-
ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.arm64 /home/.gimme/versions/gostable.linux.arm64; \
13-
ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.amd64 /home/.gimme/versions/gostable.linux.amd64
14-
ENV PATH ${PATH}:/home/.gimme/versions/gostable.linux.arm64/bin:/home/.gimme/versions/gostable.linux.amd64/bin
15-
RUN go version
165

6+
COPY --from=public.ecr.aws/docker/library/golang:1 /usr/local/go/ /usr/local/go/
7+
ENV PATH="/usr/local/go/bin:${PATH}"
178
ENV GO111MODULE on
189

1910
# The TAG args should always be set to ""
@@ -68,4 +59,4 @@ RUN cp /kinesis-streams/THIRD-PARTY /kinesis-streams/LICENSE /plugins/windows/li
6859
RUN cp /kinesis-firehose/THIRD-PARTY /kinesis-firehose/LICENSE /plugins/windows/licenses/firehose
6960
RUN cp /cloudwatch/THIRD-PARTY /cloudwatch/LICENSE /plugins/windows/licenses/cloudwatch
7061

71-
RUN tar -C /plugins/windows -cvf /plugins_windows.tar .
62+
RUN tar -C /plugins/windows -cvf /plugins_windows.tar .

0 commit comments

Comments
 (0)