Skip to content
Open
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
29 changes: 4 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,50 +1,29 @@
FROM registry.redhat.io/ubi9/go-toolset:latest as golang_builder
ARG BUILDPLATFORM
ARG ARCH

USER root

# Install yarn using npm package manager.
COPY yarn-install .
RUN npm install --offline
RUN ln -s $PWD/node_modules/yarn/bin/yarn /usr/local/bin/yarn

RUN yum install -y systemd-devel \
&& dnf module reset -y nodejs \
&& dnf module reset -y nodejs \
&& node -v \
&& yarn -v

RUN go env -w GOBIN='/go/bin'

ENV CONTROLLER_GEN_VERSION v0.9.2

# Helm installation as per https://helm.sh/docs/intro/install/
RUN tar -zxvf /cachi2/output/deps/generic/helm-linux-${BUILDPLATFORM}.tar.gz \
&& mv ./linux-${BUILDPLATFORM}/helm /usr/bin/helm

#RUN cp /cachi2/output/deps/generic/helm-linux-${BUILDPLATFORM}.tar.gz ./ \
# && tar -zxvf helm-linux-${BUILDPLATFORM}.tar.gz \
# && mv ./linux-amd64/helm /usr/bin/helm

#RUN GOFLAGS="-mod=mod" go install sigs.k8s.io/controller-tools/cmd/controller-gen@$CONTROLLER_GEN_VERSION \
# && GOFLAGS="-mod=mod" go install github.com/mitchellh/[email protected] \
# && GOFLAGS="-mod=mod" go install github.com/tcnksm/[email protected] \
# && GOFLAGS="-mod=mod" go install github.com/grafana/tanka/cmd/[email protected] \
# && GOFLAGS="-mod=mod" go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected] \
# && GOFLAGS="-mod=mod" go install github.com/google/go-jsonnet/cmd/[email protected] \
# && GOFLAGS="-mod=mod" go install github.com/golang/protobuf/[email protected] \
# && GOFLAGS="-mod=mod" go install github.com/gogo/protobuf/[email protected] \
# && GOFLAGS="-mod=mod" go install github.com/gogo/protobuf/gogoproto/[email protected] \
# && GOFLAGS="-mod=mod" go install github.com/ahmetb/[email protected] \
# && GOFLAGS="-mod=mod" go install github.com/norwoodj/helm-docs/cmd/[email protected]

COPY . /src
WORKDIR /src/alloy/internal/web/ui/
#RUN yarn install --offline --frozen-lockfile --ignore-scripts && yarn run build
RUN yarn install --offline --frozen-lockfile --ignore-scripts && yarn run --offline build

WORKDIR /src/alloy

RUN GO_TAGS="builtinassets promtail_journal_enabled" GOOS="linux" GOARCH= GOARM= make alloy
RUN GO_TAGS="builtinassets promtail_journal_enabled" GOOS="linux" GOARCH= GOARM= RELEASE_BUILD=1 make alloy

# Stage 2
FROM registry.access.redhat.com/ubi10-minimal:latest
Expand All @@ -70,7 +49,7 @@ COPY alloy/LICENSE /licenses/
# Standard Red Hat labels
LABEL com.redhat.component="alloy-container"
LABEL name="alloy"
LABEL version="v1.10.1-1"
LABEL version="v1.10.2"
LABEL summary="Provides alloy container"
LABEL io.k8s.display-name="Alloy container"
LABEL maintainer="Rakshitha Kamath <[email protected]>"
Expand Down
77 changes: 77 additions & 0 deletions Dockerfile_IBM
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
FROM --platform=$BUILDPLATFORM registry.redhat.io/ubi9/go-toolset:latest as golang_builder
ARG BUILDPLATFORM

USER root

ENV CONTROLLER_GEN_VERSION v0.9.2

RUN curl -L https://get.helm.sh/helm-v3.19.0-linux-$(echo $BUILDPLATFORM | cut -d '/' -f2).tar.gz -o ./helm.tar.gz \
&& tar -zxvf ./helm.tar.gz \
&& mv ./linux-$(echo $BUILDPLATFORM | cut -d '/' -f2)/helm /usr/bin/helm

RUN GOFLAGS="-mod=mod" go install sigs.k8s.io/controller-tools/cmd/controller-gen@$CONTROLLER_GEN_VERSION \
&& GOFLAGS="-mod=mod" go install github.com/mitchellh/[email protected] \
&& GOFLAGS="-mod=mod" go install github.com/tcnksm/[email protected] \
&& GOFLAGS="-mod=mod" go install github.com/grafana/tanka/cmd/[email protected] \
&& GOFLAGS="-mod=mod" go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected] \
&& GOFLAGS="-mod=mod" go install github.com/google/go-jsonnet/cmd/[email protected] \
&& GOFLAGS="-mod=mod" go install github.com/golang/protobuf/[email protected] \
&& GOFLAGS="-mod=mod" go install github.com/gogo/protobuf/[email protected] \
&& GOFLAGS="-mod=mod" go install github.com/gogo/protobuf/gogoproto/[email protected] \
&& GOFLAGS="-mod=mod" go install github.com/ahmetb/[email protected] \
&& GOFLAGS="-mod=mod" go install github.com/norwoodj/helm-docs/cmd/[email protected]

RUN yum install -y cmake systemd-devel \
&& npm install -g yarn \
&& node -v \
&& yarn -v

COPY . /src
WORKDIR /src/alloy/internal/web/ui/
RUN yarn --network-timeout=120000000 && yarn run build

WORKDIR /src/alloy

RUN GO_TAGS="builtinassets promtail_journal_enabled" GOOS="linux" GOARCH= GOARM= RELEASE_BUILD=1 make alloy

# Stage 2
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi10-minimal:latest

ARG UID="473"
ARG USERNAME="alloy"

RUN microdnf update -y

RUN microdnf install -y tzdata shadow-utils

COPY --from=golang_builder --chown=${UID}:${UID} /src/alloy/build/alloy /bin/alloy
COPY --chown=${UID}:${UID} ./alloy/example-config.alloy /etc/alloy/config.alloy

RUN groupadd --gid $UID $USERNAME \
&& useradd -m -u $UID -g $UID $USERNAME \
&& mkdir -p /var/lib/alloy/data \
&& chown -R $USERNAME:$USERNAME /var/lib/alloy \
&& chmod -R 770 /var/lib/alloy

COPY alloy/LICENSE /licenses/

# Standard Red Hat labels
LABEL com.redhat.component="alloy-container"
LABEL name="alloy"
LABEL version="v1.10.2"
LABEL summary="Provides alloy container"
LABEL io.k8s.display-name="Alloy container"
LABEL maintainer="Rakshitha Kamath <[email protected]>"
LABEL description="Grafana Alloy is an open source OpenTelemetry Collector distribution with built-in Prometheus pipelines and support for metrics, logs, traces, and profiles."
LABEL io.k8s.description="Grafana Alloy is an open source OpenTelemetry Collector distribution with built-in Prometheus pipelines and support for metrics, logs, traces, and profiles."
LABEL io.openshift.tags="Alloy container"

# The CPE (Common Platform Enumeration) identifier for Ceph.
LABEL cpe=cpe:/a:redhat:ceph_storage:9::el10

# Add Creation date label
LABEL org.opencontainers.image.created="${BUILD_DATE}"

ENTRYPOINT ["/bin/alloy"]
ENV ALLOY_DEPLOY_MODE=docker
CMD ["run", "/etc/alloy/config.alloy", "--storage.path=/var/lib/alloy/data"]