intel-device-plugins-for-ku.../build/docker/templates/intel-fpga-initcontainer.Dockerfile.in
Ukri Niemimuukko 30d5a2a13b Allow usage of pre-created licenses and generate dockerfiles
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>
2022-05-30 19:36:24 +03:00

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/" ]