-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy pathDockerfile.csi_wrappers
More file actions
43 lines (34 loc) · 1.37 KB
/
Dockerfile.csi_wrappers
File metadata and controls
43 lines (34 loc) · 1.37 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
# Copyright Confidential Containers Contributors
#
# SPDX-License-Identifier: Apache-2.0
#
# Builds csi wrappers images inside container
ARG SOURCE_FROM=remote
##### Builder Dev Image #####
# golang:1.25.10
FROM --platform=${BUILDPLATFORM} golang@sha256:3965b9511a9bed199f0b4eb146f99c31971a5c0adb3240d9f25e233cbd9e01c8 AS builder-local
WORKDIR /src
COPY csi-wrapper ./cloud-api-adaptor/src/csi-wrapper/
COPY cloud-api-adaptor ./cloud-api-adaptor/src/cloud-api-adaptor
##### Builder Release Image #####
# golang:1.25.10
FROM --platform=${BUILDPLATFORM} golang@sha256:3965b9511a9bed199f0b4eb146f99c31971a5c0adb3240d9f25e233cbd9e01c8 AS builder-remote
ARG BINARY
ARG CAA_SRC="https://github.com/confidential-containers/cloud-api-adaptor"
ARG CAA_SRC_REF="main"
WORKDIR /src
RUN echo $CAA_SRC
RUN echo $CAA_SRC_REF
RUN git clone ${CAA_SRC} -b ${CAA_SRC_REF} cloud-api-adaptor
FROM builder-${SOURCE_FROM} AS builder
ARG TARGETARCH
ARG BINARY
RUN cd cloud-api-adaptor/src/csi-wrapper/ && make ARCH=${TARGETARCH} ${BINARY}
# ubuntu:24.04
FROM ubuntu@sha256:0d39fcc8335d6d74d5502f6df2d30119ff4790ebbb60b364818d5112d9e3e932
ARG BINARY
ENV BINARY=${BINARY}
WORKDIR /
COPY --from=builder /src/cloud-api-adaptor/src/csi-wrapper/build/${BINARY}/${BINARY} /usr/bin/${BINARY}
COPY --from=builder /src/cloud-api-adaptor/src/csi-wrapper/entrypoint.sh /usr/bin/entrypoint.sh
ENTRYPOINT ["/usr/bin/entrypoint.sh"]