-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile.konflux
More file actions
51 lines (42 loc) · 2.08 KB
/
Copy pathDockerfile.konflux
File metadata and controls
51 lines (42 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM registry.access.redhat.com/ubi9/go-toolset:1.25.8@sha256:75ecb48dfaec6655bd589091902e3b9328c300befba34cb06fc5e7323099e17d AS builder
ARG TARGETOS=linux
ARG TARGETARCH
ARG CGO_ENABLED=1
# BUILD_TYPE=CI for hermetic konflux build (downstream)
ARG BUILD_TYPE
WORKDIR /opt/app-root/src
COPY go.mod go.sum ./
RUN go mod download
COPY cmd/ cmd/
COPY api/ api/
COPY internal/ internal/
# Obtain Helm charts into /tmp staging directories.
COPY Makefile ./
RUN mkdir -p -m 755 /tmp/batch-gateway-chart /tmp/async-processor-chart /tmp/prefetched-charts
# For all the crazy permisison denies
COPY --chown=1001:0 Dockerfile prefetched-charts* /tmp/prefetched-charts/
RUN if [ "${BUILD_TYPE}" != "CI" ]; then \
make fetch-batch-gateway && \
cp -r batch-gateway/charts/batch-gateway/* /tmp/batch-gateway-chart/ && \
make fetch-llm-d-async && \
cp -r llm-d-async/charts/async-processor/* /tmp/async-processor-chart/; \
else \
cp -r /tmp/prefetched-charts/batch-gateway/* /tmp/batch-gateway-chart/ 2>/dev/null || true; \
cp -r /tmp/prefetched-charts/async-processor/* /tmp/async-processor-chart/ 2>/dev/null || true; \
fi
RUN mkdir -p bin && \
CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
GOEXPERIMENT=strictfipsruntime \
go build -a -o bin/manager ./cmd/
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7@sha256:907b68736aa798b2d38255b7aa070b2a70acb90803864a40f05d0ec47556ddd0
WORKDIR /
COPY --from=builder /opt/app-root/src/bin/manager /manager
COPY --from=builder /tmp/batch-gateway-chart /charts/batch-gateway/
COPY --from=builder /tmp/async-processor-chart /charts/async-processor/
RUN rm -f /charts/batch-gateway/Dockerfile && \
test -f /charts/batch-gateway/Chart.yaml || \
{ echo "ERROR: /charts/batch-gateway/Chart.yaml not found. Chart directory contents:"; ls -la /charts/batch-gateway/; exit 1; } && \
test -f /charts/async-processor/Chart.yaml || \
{ echo "ERROR: /charts/async-processor/Chart.yaml not found. Chart directory contents:"; ls -la /charts/async-processor/; exit 1; }
USER 1001:1001
ENTRYPOINT ["/manager"]