File tree Expand file tree Collapse file tree 5 files changed +45
-7
lines changed Expand file tree Collapse file tree 5 files changed +45
-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 @@ -34,7 +34,14 @@ RUN GO111MODULE=on go mod download
34
34
# Copy the source
35
35
COPY ${SOURCE_CODE}/ ./
36
36
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
37
+ ARG PREBUILT_BINARY=unset
38
+
39
+ # If PREBUILT_BINARY is set, use it; otherwise, build from source
40
+ RUN if [ "$PREBUILT_BINARY" = "unset" ]; then \
41
+ 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; \
42
+ else \
43
+ cp ${PREBUILT_BINARY} /bin/driver; \
44
+ fi
38
45
39
46
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
40
47
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,15 @@ 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
+
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 GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -o /bin/persistence_agent backend/src/agent/persistence/*.go; \
44
+ else \
45
+ cp ${PREBUILT_BINARY} /bin/persistence_agent; \
46
+ fi
39
47
40
48
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
41
49
WORKDIR /bin
Original file line number Diff line number Diff line change @@ -40,7 +40,15 @@ 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
+
46
+ # If PREBUILT_BINARY is set, use it; otherwise, build from source
47
+ RUN if [ "$PREBUILT_BINARY" = "unset" ]; then \
48
+ GO111MODULE=on CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime go build -tags strictfipsruntime -o /bin/controller backend/src/crd/controller/scheduledworkflow/*.go; \
49
+ else \
50
+ cp ${PREBUILT_BINARY} /bin/controller; \
51
+ fi
44
52
45
53
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
46
54
WORKDIR /bin
You can’t perform that action at this time.
0 commit comments