File tree 5 files changed +20
-26
lines changed 5 files changed +20
-26
lines changed Original file line number Diff line number Diff line change 1
1
build_root_image :
2
2
name : release
3
3
namespace : openshift
4
- tag : rhel-8 -release-golang-1.19 -openshift-4.14
4
+ tag : rhel-9 -release-golang-1.20 -openshift-4.15
Original file line number Diff line number Diff line change 1
- FROM openshift/origin-release:golang- 1.20 AS builder
1
+ FROM registry.redhat.io/ubi9/go-toolset: 1.20.12 AS builder
2
2
3
3
ENV S2I_GIT_VERSION="" \
4
4
S2I_GIT_MAJOR="" \
5
5
S2I_GIT_MINOR=""
6
6
7
-
8
- WORKDIR /tmp/source-to-image
9
7
COPY . .
10
8
11
- USER root
12
-
13
- RUN make && cp _output/local/bin/linux/$(go env GOARCH)/s2i _output/local/go/bin/s2i
9
+ RUN CGO_ENABLED=0 go build -a -ldflags="-s -w" -o /tmp/s2i ./cmd/s2i
14
10
15
11
#
16
12
# Runner Image
17
13
#
18
14
19
- FROM registry.redhat.io/ubi8 /ubi
15
+ FROM registry.redhat.io/ubi9 /ubi-minimal:9.4
20
16
21
- COPY --from=builder /tmp/source-to-image/_output/local/go/bin/ s2i /usr/local/bin/s2i
17
+ COPY --from=builder /tmp/s2i /usr/local/bin/s2i
22
18
23
19
USER 1001
24
20
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ OUT_DIR = _output
12
12
13
13
export GOFLAGS
14
14
15
+ VERSION = latest
16
+ CONTAINER_ENGINE = podman
17
+
15
18
# Build code.
16
19
#
17
20
# Args:
@@ -24,6 +27,9 @@ all build:
24
27
hack/build-go.sh
25
28
.PHONY : all build
26
29
30
+ build-container :
31
+ ${CONTAINER_ENGINE} build -t localhost/source-to-image/s2i:${VERSION} .
32
+
27
33
# Verify if code is properly organized.
28
34
#
29
35
# Example:
@@ -97,6 +103,6 @@ clean:
97
103
# Example:
98
104
# make release
99
105
release : clean
100
- hack/build-release.sh
106
+ S2I_BUILD_CMD= " ${CONTAINER_ENGINE} " hack/build-release.sh
101
107
hack/extract-release.sh
102
108
.PHONY : release
Original file line number Diff line number Diff line change @@ -37,11 +37,11 @@ echo "++ Building release ${S2I_GIT_VERSION}"
37
37
# Perform the build and release in podman or docker.
38
38
if [[ " $( go env GOHOSTOS) " == " darwin" ]]; then
39
39
$buildCmd run --rm -it -e RELEASE_LDFLAGS=" -w -s" \
40
- -v " ${S2I_ROOT} " :/go/src/github.com/openshift /source-to-image \
40
+ -v " ${S2I_ROOT} " :/opt/app-root/src /source-to-image \
41
41
openshift/sti-release
42
42
else
43
43
$buildCmd run --rm -it -e RELEASE_LDFLAGS=" -w -s" \
44
- -v " ${S2I_ROOT} " :/go/src/github.com/openshift /source-to-image:z \
44
+ -v " ${S2I_ROOT} " :/opt/app-root/src /source-to-image:z \
45
45
openshift/sti-release
46
46
fi
47
47
Original file line number Diff line number Diff line change 3
3
#
4
4
# The standard name for this image is openshift/sti-release
5
5
#
6
- FROM registry.redhat.io/ubi8/ubi
6
+ FROM registry.redhat.io/ubi9/go-toolset:1.20.12 AS builder
7
7
8
- ENV VERSION=1.20 \
9
- GOARM=5 \
10
- GOPATH=/go \
11
- GOROOT=/usr/local/go \
12
- S2I_VERSION_FILE=/go/src/github.com/openshift/source-to-image/sti-version-defs
13
- ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
8
+ USER root
9
+ ENV S2I_VERSION_FILE=/opt/app-root/src/source-to-image/sti-version-defs
14
10
15
- RUN yum install -y git gcc zip && \
16
- yum clean all && \
17
- curl https://storage.googleapis.com/golang/go$VERSION.linux-amd64.tar.gz | tar -C /usr/local -xzf - && \
18
- touch /sti-build-image && \
19
- mkdir -p /go/src/github.com/openshift/source-to-image
11
+ RUN mkdir -p /opt/app-root/src/source-to-image
20
12
21
- WORKDIR /go/src/github.com/openshift /source-to-image
22
- VOLUME ["/go/src/github.com/openshift /source-to-image" ]
13
+ WORKDIR /opt/app-root/src /source-to-image
14
+ VOLUME ["/opt/app-root/src /source-to-image" ]
23
15
# Expect source to be mounted in
24
16
CMD ["./hack/build-cross.sh" ]
You can’t perform that action at this time.
0 commit comments