File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ # Initialized TARGETPLATFORM with default value
16
+ ARG TARGETPLATFORM=linux/amd64
17
+
15
18
FROM golang:1.17 AS builder
16
19
WORKDIR /go/src/sigs.k8s.io/ibm-powervs-block-csi-driver
17
20
ADD . .
18
- RUN make driver node-update-controller
21
+ RUN GOARCH=$(echo $TARGETPLATFORM | cut -f2 -d '/' ) make driver node-update-controller
19
22
20
23
# debian base image
21
24
FROM k8s.gcr.io/build-image/debian-base:v2.1.3 AS debian-base
@@ -24,7 +27,7 @@ COPY --from=builder /go/src/sigs.k8s.io/ibm-powervs-block-csi-driver/bin/* /
24
27
ENTRYPOINT ["/ibm-powervs-block-csi-driver" ]
25
28
26
29
# centos base image
27
- FROM quay.io/centos/centos:stream8 AS centos-base
30
+ FROM --platform=$TARGETPLATFORM quay.io/centos/centos:stream8 AS centos-base
28
31
RUN yum install -y util-linux nfs-utils e2fsprogs xfsprogs ca-certificates && yum clean all && rm -rf /var/cache/yum
29
32
COPY --from=builder /go/src/sigs.k8s.io/ibm-powervs-block-csi-driver/bin/* /
30
33
ENTRYPOINT ["/ibm-powervs-block-csi-driver" ]
Original file line number Diff line number Diff line change 45
45
46
46
.PHONY : image
47
47
image :
48
- docker build -t $(REGISTRY ) /$(IMG ) :$(TAG ) . --target debian -base
48
+ docker build -t $(REGISTRY ) /$(IMG ) :$(TAG ) . --target centos -base
49
49
50
50
.PHONY : push
51
51
push :
@@ -55,16 +55,16 @@ build-image-and-push-linux-amd64: init-buildx
55
55
{ \
56
56
set -e ; \
57
57
docker buildx build \
58
- --platform linux/amd64 \
59
- -t $(REGISTRY ) /$(IMG ) :$(TAG ) _linux_amd64 --push . --target debian -base; \
58
+ --build-arg TARGETPLATFORM= linux/amd64 \
59
+ -t $(REGISTRY ) /$(IMG ) :$(TAG ) _linux_amd64 --push . --target centos -base; \
60
60
}
61
61
62
62
build-image-and-push-linux-ppc64le : init-buildx
63
63
{ \
64
64
set -e ; \
65
65
docker buildx build \
66
- --platform linux/ppc64le \
67
- -t $(REGISTRY ) /$(IMG ) :$(TAG ) _linux_ppc64le --push . --target debian -base; \
66
+ --build-arg TARGETPLATFORM= linux/ppc64le \
67
+ -t $(REGISTRY ) /$(IMG ) :$(TAG ) _linux_ppc64le --push . --target centos -base; \
68
68
}
69
69
70
70
build-and-push-multi-arch : build-image-and-push-linux-amd64 build-image-and-push-linux-ppc64le
You can’t perform that action at this time.
0 commit comments