FROM public.ecr.aws/lts/ubuntu:latest RUN apt-get update RUN apt-get install -y tar gzip git make gcc curl gcc-multilib gcc-mingw-w64 RUN curl -sL -o /bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme RUN chmod +x /bin/gimme ENV HOME /home # Lock Go Lang version to stable RUN export GO_STABLE_VERSION=`curl --silent https://go.dev/VERSION?m=text | cut -d "o" -f 2`; \ echo "Using go:stable version ${GO_STABLE_VERSION}"; \ gimme ${GO_STABLE_VERSION}; \ ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.arm64 /home/.gimme/versions/gostable.linux.arm64; \ ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.amd64 /home/.gimme/versions/gostable.linux.amd64 ENV PATH ${PATH}:/home/.gimme/versions/gostable.linux.arm64/bin:/home/.gimme/versions/gostable.linux.amd64/bin RUN go version ENV GO111MODULE on # The TAG args should always be set to "" # The build_plugins.sh will set them from the windows.versions and linux.version files ARG KINESIS_PLUGIN_CLONE_URL=https://github.com/aws/amazon-kinesis-streams-for-fluent-bit.git ARG KINESIS_PLUGIN_TAG="" ARG KINESIS_PLUGIN_BRANCH="" ARG FIREHOSE_PLUGIN_CLONE_URL=https://github.com/aws/amazon-kinesis-firehose-for-fluent-bit.git ARG FIREHOSE_PLUGIN_TAG="" ARG FIREHOSE_PLUGIN_BRANCH="" ARG CLOUDWATCH_PLUGIN_CLONE_URL=https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit.git ARG CLOUDWATCH_PLUGIN_TAG="" ARG CLOUDWATCH_PLUGIN_BRANCH="" # Kinesis Streams RUN git clone $KINESIS_PLUGIN_CLONE_URL /kinesis-streams WORKDIR /kinesis-streams RUN if [ -n "$KINESIS_PLUGIN_BRANCH" ];then git fetch --all && git checkout $KINESIS_PLUGIN_BRANCH && git remote -v;fi RUN if [ -z "$KINESIS_PLUGIN_BRANCH" ];then git fetch --all --tags && git checkout tags/$KINESIS_PLUGIN_TAG -b $KINESIS_PLUGIN_TAG && git describe --tags;fi RUN go mod download || ( go env -w GOPROXY=direct && go mod download ) RUN make windows-release # Firehose RUN git clone $FIREHOSE_PLUGIN_CLONE_URL /kinesis-firehose WORKDIR /kinesis-firehose RUN if [ -n "$FIREHOSE_PLUGIN_BRANCH" ];then git fetch --all && git checkout $FIREHOSE_PLUGIN_BRANCH && git remote -v;fi RUN if [ -z "$FIREHOSE_PLUGIN_BRANCH" ];then git fetch --all --tags && git checkout tags/$FIREHOSE_PLUGIN_TAG -b $FIREHOSE_PLUGIN_TAG && git describe --tags;fi RUN go mod download || ( go env -w GOPROXY=direct && go mod download ) RUN make windows-release # CloudWatch RUN git clone $CLOUDWATCH_PLUGIN_CLONE_URL /cloudwatch WORKDIR /cloudwatch RUN if [ -n "$CLOUDWATCH_PLUGIN_BRANCH" ];then git fetch --all && git checkout $CLOUDWATCH_PLUGIN_BRANCH && git remote -v;fi 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 RUN go mod download || ( go env -w GOPROXY=direct && go mod download ) RUN make windows-release # Add all the built artifacts to an output folder and create an archive # We can copy this to the host for saving the artifacts RUN mkdir -p /plugins/windows/licenses/kinesis /plugins/windows/licenses/firehose /plugins/windows/licenses/cloudwatch # Copy binaries RUN cp /kinesis-streams/bin/*.dll /kinesis-firehose/bin/*.dll /cloudwatch/bin/*.dll /plugins/windows # Copy licenses RUN cp /kinesis-streams/THIRD-PARTY /kinesis-streams/LICENSE /plugins/windows/licenses/kinesis RUN cp /kinesis-firehose/THIRD-PARTY /kinesis-firehose/LICENSE /plugins/windows/licenses/firehose RUN cp /cloudwatch/THIRD-PARTY /cloudwatch/LICENSE /plugins/windows/licenses/cloudwatch RUN tar -C /plugins/windows -cvf /plugins_windows.tar .