Skip to content

Commit a6a40f3

Browse files
Rakshitha-Kamathrakshithakamath94
authored andcommitted
This PR contains the following changes,
[1] Add seperate Dockerfile for IBM SPS build [2] Remove unwanted lines from the Konflux Dockerfile Signed-off-by: Rakshitha-Kamath <[email protected]>
1 parent ca896af commit a6a40f3

File tree

2 files changed

+81
-25
lines changed

2 files changed

+81
-25
lines changed

Dockerfile

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,29 @@
11
FROM registry.redhat.io/ubi9/go-toolset:latest as golang_builder
22
ARG BUILDPLATFORM
3-
ARG ARCH
43

54
USER root
65

6+
# Install yarn using npm package manager.
77
COPY yarn-install .
88
RUN npm install --offline
99
RUN ln -s $PWD/node_modules/yarn/bin/yarn /usr/local/bin/yarn
1010

1111
RUN yum install -y systemd-devel \
12-
&& dnf module reset -y nodejs \
12+
&& dnf module reset -y nodejs \
1313
&& node -v \
1414
&& yarn -v
1515

16-
RUN go env -w GOBIN='/go/bin'
17-
18-
ENV CONTROLLER_GEN_VERSION v0.9.2
19-
2016
# Helm installation as per https://helm.sh/docs/intro/install/
2117
RUN tar -zxvf /cachi2/output/deps/generic/helm-linux-${BUILDPLATFORM}.tar.gz \
2218
&& mv ./linux-${BUILDPLATFORM}/helm /usr/bin/helm
2319

24-
#RUN cp /cachi2/output/deps/generic/helm-linux-${BUILDPLATFORM}.tar.gz ./ \
25-
# && tar -zxvf helm-linux-${BUILDPLATFORM}.tar.gz \
26-
# && mv ./linux-amd64/helm /usr/bin/helm
27-
28-
#RUN GOFLAGS="-mod=mod" go install sigs.k8s.io/controller-tools/cmd/controller-gen@$CONTROLLER_GEN_VERSION \
29-
# && GOFLAGS="-mod=mod" go install github.com/mitchellh/[email protected] \
30-
# && GOFLAGS="-mod=mod" go install github.com/tcnksm/[email protected] \
31-
# && GOFLAGS="-mod=mod" go install github.com/grafana/tanka/cmd/[email protected] \
32-
# && GOFLAGS="-mod=mod" go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected] \
33-
# && GOFLAGS="-mod=mod" go install github.com/google/go-jsonnet/cmd/[email protected] \
34-
# && GOFLAGS="-mod=mod" go install github.com/golang/protobuf/[email protected] \
35-
# && GOFLAGS="-mod=mod" go install github.com/gogo/protobuf/[email protected] \
36-
# && GOFLAGS="-mod=mod" go install github.com/gogo/protobuf/gogoproto/[email protected] \
37-
# && GOFLAGS="-mod=mod" go install github.com/ahmetb/[email protected] \
38-
# && GOFLAGS="-mod=mod" go install github.com/norwoodj/helm-docs/cmd/[email protected]
39-
4020
COPY . /src
4121
WORKDIR /src/alloy/internal/web/ui/
42-
#RUN yarn install --offline --frozen-lockfile --ignore-scripts && yarn run build
4322
RUN yarn install --offline --frozen-lockfile --ignore-scripts && yarn run --offline build
4423

4524
WORKDIR /src/alloy
4625

47-
RUN GO_TAGS="builtinassets promtail_journal_enabled" GOOS="linux" GOARCH= GOARM= make alloy
26+
RUN GO_TAGS="builtinassets promtail_journal_enabled" GOOS="linux" GOARCH= GOARM= RELEASE_BUILD=1 make alloy
4827

4928
# Stage 2
5029
FROM registry.access.redhat.com/ubi10-minimal:latest
@@ -70,7 +49,7 @@ COPY alloy/LICENSE /licenses/
7049
# Standard Red Hat labels
7150
LABEL com.redhat.component="alloy-container"
7251
LABEL name="alloy"
73-
LABEL version="v1.10.1-1"
52+
LABEL version="v1.10.2"
7453
LABEL summary="Provides alloy container"
7554
LABEL io.k8s.display-name="Alloy container"
7655
LABEL maintainer="Rakshitha Kamath <[email protected]>"

Dockerfile_IBM

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
FROM --platform=$BUILDPLATFORM registry.redhat.io/ubi9/go-toolset:latest as golang_builder
2+
ARG BUILDPLATFORM
3+
4+
USER root
5+
6+
ENV CONTROLLER_GEN_VERSION v0.9.2
7+
8+
RUN curl -L https://get.helm.sh/helm-v3.19.0-linux-$(echo $BUILDPLATFORM | cut -d '/' -f2).tar.gz -o ./helm.tar.gz \
9+
&& tar -zxvf ./helm.tar.gz \
10+
&& mv ./linux-$(echo $BUILDPLATFORM | cut -d '/' -f2)/helm /usr/bin/helm
11+
12+
RUN GOFLAGS="-mod=mod" go install sigs.k8s.io/controller-tools/cmd/controller-gen@$CONTROLLER_GEN_VERSION \
13+
&& GOFLAGS="-mod=mod" go install github.com/mitchellh/[email protected] \
14+
&& GOFLAGS="-mod=mod" go install github.com/tcnksm/[email protected] \
15+
&& GOFLAGS="-mod=mod" go install github.com/grafana/tanka/cmd/[email protected] \
16+
&& GOFLAGS="-mod=mod" go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected] \
17+
&& GOFLAGS="-mod=mod" go install github.com/google/go-jsonnet/cmd/[email protected] \
18+
&& GOFLAGS="-mod=mod" go install github.com/golang/protobuf/[email protected] \
19+
&& GOFLAGS="-mod=mod" go install github.com/gogo/protobuf/[email protected] \
20+
&& GOFLAGS="-mod=mod" go install github.com/gogo/protobuf/gogoproto/[email protected] \
21+
&& GOFLAGS="-mod=mod" go install github.com/ahmetb/[email protected] \
22+
&& GOFLAGS="-mod=mod" go install github.com/norwoodj/helm-docs/cmd/[email protected]
23+
24+
RUN yum install -y cmake systemd-devel \
25+
&& npm install -g yarn \
26+
&& node -v \
27+
&& yarn -v
28+
29+
COPY . /src
30+
WORKDIR /src/alloy/internal/web/ui/
31+
RUN yarn --network-timeout=120000000 && yarn run build
32+
33+
WORKDIR /src/alloy
34+
35+
RUN GO_TAGS="builtinassets promtail_journal_enabled" GOOS="linux" GOARCH= GOARM= RELEASE_BUILD=1 make alloy
36+
37+
# Stage 2
38+
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi10-minimal:latest
39+
40+
ARG UID="473"
41+
ARG USERNAME="alloy"
42+
43+
RUN microdnf update -y
44+
45+
RUN microdnf install -y tzdata shadow-utils
46+
47+
COPY --from=golang_builder --chown=${UID}:${UID} /src/alloy/build/alloy /bin/alloy
48+
COPY --chown=${UID}:${UID} ./alloy/example-config.alloy /etc/alloy/config.alloy
49+
50+
RUN groupadd --gid $UID $USERNAME \
51+
&& useradd -m -u $UID -g $UID $USERNAME \
52+
&& mkdir -p /var/lib/alloy/data \
53+
&& chown -R $USERNAME:$USERNAME /var/lib/alloy \
54+
&& chmod -R 770 /var/lib/alloy
55+
56+
COPY alloy/LICENSE /licenses/
57+
58+
# Standard Red Hat labels
59+
LABEL com.redhat.component="alloy-container"
60+
LABEL name="alloy"
61+
LABEL version="v1.10.2"
62+
LABEL summary="Provides alloy container"
63+
LABEL io.k8s.display-name="Alloy container"
64+
LABEL maintainer="Rakshitha Kamath <[email protected]>"
65+
LABEL description="Grafana Alloy is an open source OpenTelemetry Collector distribution with built-in Prometheus pipelines and support for metrics, logs, traces, and profiles."
66+
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."
67+
LABEL io.openshift.tags="Alloy container"
68+
69+
# The CPE (Common Platform Enumeration) identifier for Ceph.
70+
LABEL cpe=cpe:/a:redhat:ceph_storage:9::el10
71+
72+
# Add Creation date label
73+
LABEL org.opencontainers.image.created="${BUILD_DATE}"
74+
75+
ENTRYPOINT ["/bin/alloy"]
76+
ENV ALLOY_DEPLOY_MODE=docker
77+
CMD ["run", "/etc/alloy/config.alloy", "--storage.path=/var/lib/alloy/data"]

0 commit comments

Comments
 (0)