mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00

As a build optimization, allow usage of pre-created licenses. Together with usage of go mod vendor, the container build times are significantly shorter. Dockerfiles are generated from include-snippets on the fly. Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
40 lines
1.1 KiB
Docker
40 lines
1.1 KiB
Docker
#include "final_base.docker"
|
|
#include "golang_base.docker"
|
|
|
|
FROM ${GOLANG_BASE} as builder
|
|
|
|
#include "default_args.docker"
|
|
ARG CRI_HOOK=intel-fpga-crihook
|
|
|
|
ARG CMD=fpga_crihook
|
|
ARG EP=/usr/local/fpga-sw/$CRI_HOOK
|
|
#include "default_build.docker"
|
|
|
|
ARG CMD=fpga_tool
|
|
ARG EP=/usr/local/fpga-sw/$CMD
|
|
#include "default_build.docker"
|
|
|
|
ARG SRC_DIR=/usr/local/fpga-sw
|
|
ARG DST_DIR=/opt/intel/fpga-sw
|
|
|
|
RUN echo "{\n\N
|
|
\"hook\" : \"$DST_DIR/$CRI_HOOK\",\n\N
|
|
\"stage\" : [ \"prestart\" ],\n\N
|
|
\"annotation\": [ \"fpga.intel.com/region\" ]\n\N
|
|
}\n">>/install_root/$SRC_DIR/$CRI_HOOK.json
|
|
|
|
#include "toybox_build.docker"
|
|
|
|
FROM ${FINAL_BASE}
|
|
|
|
#include "default_labels.docker"
|
|
|
|
LABEL name='intel-fpga-initcontainer'
|
|
LABEL summary='Intel® FPGA programming CRI hook for Kubernetes'
|
|
LABEL description='The FPGA prestart CRI-O hook performs discovery of the requested FPGA function bitstream and programs FPGA devices based on the environment variables in the workload description'
|
|
|
|
COPY --from=builder /install_root /
|
|
|
|
ENTRYPOINT [ "/bin/sh", "-c", "cp -a /usr/local/fpga-sw/* /opt/intel/fpga-sw/ && ln -sf /opt/intel/fpga-sw/intel-fpga-crihook.json /etc/containers/oci/hooks.d/" ]
|
|
|