intel-device-plugins-for-ku.../build/docker/templates/intel-vpu-plugin.Dockerfile.in
Tuomas Katila e9267e43c9 Improve dockerfiles based on feedback from hadolint
Co-authored-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2022-10-14 08:22:57 +03:00

36 lines
1.1 KiB
Docker

#include "final_base.docker"
#include "golang_base.docker"
FROM ${GOLANG_BASE} as builder
#include "default_args.docker"
ARG CMD=vpu_plugin
WORKDIR $DIR
COPY . .
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN echo "deb-src http://deb.debian.org/debian unstable main" | tee -a /etc/apt/sources.list
RUN apt-get update && apt-get --no-install-recommends -y install dpkg-dev libusb-1.0-0-dev
RUN mkdir -p /install_root/licenses/libusb \
&& (cd /install_root/licenses/libusb && apt-get --download-only source libusb-1.0-0)
RUN (cd cmd/$CMD; GO111MODULE=${GO111MODULE} CGO_ENABLED=1 go install "${BUILDFLAGS}") \
&& install -D /go/bin/vpu_plugin /install_root/usr/local/bin/intel_vpu_device_plugin
#include "default_licenses.docker"
FROM debian:unstable-slim
#include "default_labels.docker"
LABEL name='intel-vpu-plugin'
LABEL summary='Intel® VPU device plugin for Kubernetes'
RUN apt-get update && apt-get --no-install-recommends -y install libusb-1.0-0 && rm -rf /var/lib/apt/lists/\*
COPY --from=builder /install_root /
ENTRYPOINT ["/usr/local/bin/intel_vpu_device_plugin"]