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

feat: add Dockerfile and Makefile target to build UBI based sidecar container image #194

Merged
merged 2 commits into from
Jul 28, 2021
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
6 changes: 3 additions & 3 deletions operator/Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ ARG RELEASE_NUMBER=${RELEASE_NUMBER}

LABEL name="Tailing Sidecar Operator" \
maintainer="[email protected]" \
vendor="sumologic" \
vendor="Sumo Logic" \
version=${VERSION} \
release=${RELEASE_NUMBER} \
summary="Tailing Sidecar Operator" \
description="Tailing Sidecar Operator adds streaming sidecar containers which use tailing sidecar image to Pods"
summary="UBI based Tailing Sidecar Operator" \
description="Tailing Sidecar Operator adds streaming sidecar containers which use tailing sidecar image to Pods."

ADD https://raw.githubusercontent.com/SumoLogic/tailing-sidecar/release-v0.3/LICENSE /licenses/LICENSE

Expand Down
32 changes: 32 additions & 0 deletions sidecar/Dockerfile.ubi
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM golang:1.16.2 as go-builder
RUN mkdir /build
ADD ./out_gstdout /build/
WORKDIR /build
RUN make all

FROM public.ecr.aws/sumologic/fluent-bit:1.6.10-ubi

ARG VERSION=${VERSION}
ARG RELEASE_NUMBER=${RELEASE_NUMBER}

LABEL name="Tailing Sidecar" \
maintainer="[email protected]" \
vendor="Sumo Logic" \
version=${VERSION} \
release=${RELEASE_NUMBER} \
summary="UBI based Tailing Sidecar" \
description="Tailing sidecar is a streaming sidecar container which can be used with Tailing Sidecar Operator."

ADD https://raw.githubusercontent.com/SumoLogic/tailing-sidecar/release-v0.3/LICENSE /licenses/LICENSE

ENV LOG_LEVEL=warning

COPY --from=go-builder \
/build/out_gstdout.so \
/tailing-sidecar/lib/

COPY conf/fluent-bit.conf \
conf/plugins.conf \
/fluent-bit/etc/

CMD ["/fluent-bit/bin/fluent-bit", "-c", "/fluent-bit/etc/fluent-bit.conf", "--quiet"]
7 changes: 7 additions & 0 deletions sidecar/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ all: build push
build:
docker build --tag $(TAG) --file ${root_dir}sidecar/Dockerfile ${root_dir}sidecar/

build-ubi:
docker build \
--tag $(TAG) \
--build-arg VERSION=${VERSION} \
--build-arg RELEASE_NUMBER=${RELEASE_NUMBER} \
--file ${root_dir}sidecar/Dockerfile.ubi ${root_dir}sidecar/

run: build
docker run --rm -it \
-v $(DIR_TO_TAIL):/tmp/host \
Expand Down