-
Notifications
You must be signed in to change notification settings - Fork 84
/
Dockerfile.csi_wrappers
40 lines (31 loc) · 1.22 KB
/
Dockerfile.csi_wrappers
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
# Copyright Confidential Containers Contributors
#
# SPDX-License-Identifier: Apache-2.0
#
# Builds csi wrappers images inside container
ARG SOURCE_FROM=remote
##### Builder Dev Image #####
FROM --platform=${BUILDPLATFORM} quay.io/confidential-containers/golang-fedora:1.21.12-39 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 #####
FROM --platform=${BUILDPLATFORM} quay.io/confidential-containers/golang-fedora:1.21.12-39 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}
FROM ubuntu:20.04
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"]