File tree Expand file tree Collapse file tree 5 files changed +49
-7
lines changed Expand file tree Collapse file tree 5 files changed +49
-7
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,15 @@ RUN GO111MODULE=on go mod download
31
31
# Copy the source
32
32
COPY ${SOURCE_CODE}/ ./
33
33
34
- RUN GO111MODULE=on CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -o /bin/apiserver ./backend/src/apiserver/ && \
35
- dnf clean all
34
+ # Accept an optional prebuilt Go binary
35
+ ARG PREBUILT_BINARY="unset"
36
+
37
+ RUN if [ "$PREBUILT_BINARY" = "unset" ]; then \
38
+ GO111MODULE=on CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -o /bin/apiserver ./backend/src/apiserver/ ;\
39
+ else \
40
+ cp "${PREBUILT_BINARY}" /bin/apiserver ;\
41
+ fi \
42
+ && dnf clean all
36
43
37
44
# 2. Compile preloaded pipeline samples
38
45
FROM registry.access.redhat.com/ubi9/python-39:9.5 as compiler
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ FROM registry.access.redhat.com/ubi9/go-toolset:1.23 as builder
20
20
21
21
## Build args to be used at this step
22
22
ARG SOURCE_CODE
23
+ ARG PREBUILT_BINARY="unset"
23
24
24
25
## Switch to root as required for some operations
25
26
USER root
@@ -34,7 +35,15 @@ RUN GO111MODULE=on go mod download
34
35
# Copy the source
35
36
COPY ${SOURCE_CODE}/ ./
36
37
37
- RUN GO111MODULE=on CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GOEXPERIMENT=strictfipsruntime go build -tags 'netgo strictfipsruntime' -o /bin/driver ./backend/src/v2/cmd/driver/*.go
38
+ # Accept an optional prebuilt Go binary
39
+ COPY ${PREBUILT_BINARY} /tmp/prebuilt-driver
40
+
41
+ # If PREBUILT_BINARY is set, use it; otherwise, build from source
42
+ RUN if [ "$PREBUILT_BINARY" = "unset" ]; then \
43
+ GO111MODULE=on CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GOEXPERIMENT=strictfipsruntime go build -tags 'netgo strictfipsruntime' -o /bin/driver ./backend/src/v2/cmd/driver/*.go; \
44
+ else \
45
+ cp /tmp/prebuilt-driver /bin/driver; \
46
+ fi
38
47
39
48
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
40
49
Original file line number Diff line number Diff line change @@ -36,8 +36,16 @@ RUN GO111MODULE=on go mod download
36
36
# Copy the source
37
37
COPY ${SOURCE_CODE}/ ./
38
38
39
- RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-extldflags "-static"' -o /bin/launcher-v2 ./backend/src/v2/cmd/launcher-v2/*.go
40
- RUN GO111MODULE=on CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GOEXPERIMENT=strictfipsruntime go build -tags 'netgo strictfipsruntime' -o /bin/launcher-v2-fips ./backend/src/v2/cmd/launcher-v2/*.go
39
+ # Accept an optional prebuilt Go binary
40
+ ARG PREBUILT_BINARY="unset"
41
+
42
+ RUN if [ "$PREBUILT_BINARY" = "unset" ]; then \
43
+ GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-extldflags "-static"' -o /bin/launcher-v2 ./backend/src/v2/cmd/launcher-v2/*.go && \
44
+ GO111MODULE=on CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GOEXPERIMENT=strictfipsruntime go build -tags 'netgo strictfipsruntime' -o /bin/launcher-v2-fips ./backend/src/v2/cmd/launcher-v2/*.go ;\
45
+ else \
46
+ cp "${PREBUILT_BINARY}" /bin/launcher-v2 && \
47
+ cp "${PREBUILT_BINARY}" /bin/launcher-v2-fips ;\
48
+ fi
41
49
42
50
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
43
51
Original file line number Diff line number Diff line change @@ -35,7 +35,16 @@ RUN GO111MODULE=on go mod download
35
35
# Copy the source
36
36
COPY ${SOURCE_CODE}/ ./
37
37
38
- RUN GO111MODULE=on CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -o /bin/persistence_agent backend/src/agent/persistence/*.go
38
+ # Accept an optional prebuilt Go binary
39
+ ARG PREBUILT_BINARY="unset"
40
+ COPY ${PREBUILT_BINARY} /tmp/prebuilt-persistence-agent
41
+
42
+ # If PREBUILT_BINARY is set, use it; otherwise, build from source
43
+ RUN if [ "$PREBUILT_BINARY" = "unset" ]; then \
44
+ GO111MODULE=on CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -o /bin/persistence_agent backend/src/agent/persistence/*.go; \
45
+ else \
46
+ cp /tmp/prebuilt-persistence-agent /bin/persistence_agent; \
47
+ fi
39
48
40
49
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
41
50
WORKDIR /bin
Original file line number Diff line number Diff line change @@ -40,7 +40,16 @@ RUN GO111MODULE=on go mod download
40
40
# Copy the source
41
41
COPY ${SOURCE_CODE}/ ./
42
42
43
- RUN GO111MODULE=on CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -o /bin/controller backend/src/crd/controller/scheduledworkflow/*.go
43
+ # Accept an optional prebuilt Go binary
44
+ ARG PREBUILT_BINARY="unset"
45
+ COPY ${PREBUILT_BINARY} /tmp/prebuilt-controller
46
+
47
+ # If PREBUILT_BINARY is set, use it; otherwise, build from source
48
+ RUN if [ "$PREBUILT_BINARY" = "unset" ]; then \
49
+ GO111MODULE=on CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -o /bin/controller backend/src/crd/controller/scheduledworkflow/*.go; \
50
+ else \
51
+ cp /tmp/prebuilt-controller /bin/controller; \
52
+ fi
44
53
45
54
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
46
55
WORKDIR /bin
You can’t perform that action at this time.
0 commit comments