forked from beraldoleal/cloud-api-adaptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
21 lines (20 loc) · 1.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM --platform=$BUILDPLATFORM golang:1.18 AS builder
ARG TARGETARCH
ARG RELEASE_BUILD
ENV RELEASE_BUILD=${RELEASE_BUILD}
COPY . cloud-api-adaptor
RUN git clone -b CCv0 https://github.com/kata-containers/kata-containers
WORKDIR cloud-api-adaptor
# Install additional packages required to build libvirt provider
# Need to use the [] syntax as default shell is /bin/sh
RUN if [ "$RELEASE_BUILD" != "true" ] ; then apt-get update -y && apt-get install -y libvirt-dev; fi
RUN ARCH=$TARGETARCH make
FROM --platform=$TARGETPLATFORM fedora:36
ARG RELEASE_BUILD
ENV RELEASE_BUILD=${RELEASE_BUILD}
# Install additional packages required when using libvirt provider
# Need to use the [] syntax as default shell is /bin/sh
RUN if [ "$RELEASE_BUILD" != "true" ] ; then dnf install -y libvirt-libs genisoimage /usr/bin/ssh && dnf clean all; fi
COPY --from=builder /go/cloud-api-adaptor/cloud-api-adaptor /usr/local/bin/cloud-api-adaptor
COPY --from=builder /go/cloud-api-adaptor/entrypoint.sh /usr/local/bin/entrypoint.sh
CMD ["entrypoint.sh"]