|
| 1 | +## This is a generated file, do not edit directly. Edit build/docker/templates/intel-gpu-fakedev.Dockerfile.in instead. |
| 2 | +## |
| 3 | +## Copyright 2022 Intel Corporation. All Rights Reserved. |
| 4 | +## |
| 5 | +## Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +## you may not use this file except in compliance with the License. |
| 7 | +## You may obtain a copy of the License at |
| 8 | +## |
| 9 | +## http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +## |
| 11 | +## Unless required by applicable law or agreed to in writing, software |
| 12 | +## distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +## See the License for the specific language governing permissions and |
| 15 | +## limitations under the License. |
| 16 | +### |
| 17 | +ARG CMD=gpu_fakedev |
| 18 | +## FINAL_BASE can be used to configure the base image of the final image. |
| 19 | +## |
| 20 | +## This is used in two ways: |
| 21 | +## 1) make <image-name> BUILDER=<docker|buildah> |
| 22 | +## 2) docker build ... -f <image-name>.Dockerfile |
| 23 | +## |
| 24 | +## The project default is 1) which sets FINAL_BASE=gcr.io/distroless/static |
| 25 | +## (see build-image.sh). |
| 26 | +## 2) and the default FINAL_BASE is primarily used to build Redhat Certified Openshift Operator container images that must be UBI based. |
| 27 | +## The RedHat build tool does not allow additional image build parameters. |
| 28 | +ARG FINAL_BASE=registry.access.redhat.com/ubi8-micro:latest |
| 29 | +### |
| 30 | +## |
| 31 | +## GOLANG_BASE can be used to make the build reproducible by choosing an |
| 32 | +## image by its hash: |
| 33 | +## GOLANG_BASE=golang@sha256:9d64369fd3c633df71d7465d67d43f63bb31192193e671742fa1c26ebc3a6210 |
| 34 | +## |
| 35 | +## This is used on release branches before tagging a stable version. |
| 36 | +## The main branch defaults to using the latest Golang base image. |
| 37 | +ARG GOLANG_BASE=golang:1.19-bullseye |
| 38 | +### |
| 39 | +FROM ${GOLANG_BASE} as builder |
| 40 | +ARG DIR=/intel-device-plugins-for-kubernetes |
| 41 | +ARG GO111MODULE=on |
| 42 | +ARG BUILDFLAGS="-ldflags=-w -s" |
| 43 | +ARG GOLICENSES_VERSION |
| 44 | +ARG EP=/usr/local/bin/intel_gpu_fakedev |
| 45 | +ARG CMD |
| 46 | +WORKDIR ${DIR} |
| 47 | +COPY . . |
| 48 | +RUN (cd cmd/${CMD}; GO111MODULE=${GO111MODULE} CGO_ENABLED=0 go install "${BUILDFLAGS}") && install -D /go/bin/${CMD} /install_root${EP} |
| 49 | +RUN install -D ${DIR}/LICENSE /install_root/licenses/intel-device-plugins-for-kubernetes/LICENSE \ |
| 50 | + && if [ ! -d "licenses/$CMD" ] ; then \ |
| 51 | + GO111MODULE=on go run github.com/google/go-licenses@${GOLICENSES_VERSION} save "./cmd/$CMD" \ |
| 52 | + --save_path /install_root/licenses/$CMD/go-licenses ; \ |
| 53 | + else mkdir -p /install_root/licenses/$CMD/go-licenses/ && cd licenses/$CMD && cp -r * /install_root/licenses/$CMD/go-licenses/ ; fi |
| 54 | +### |
| 55 | +FROM ${FINAL_BASE} |
| 56 | +COPY --from=builder /install_root / |
| 57 | +ENTRYPOINT ["/usr/local/bin/intel_gpu_fakedev"] |
| 58 | +LABEL vendor='Intel®' |
| 59 | +LABEL version='devel' |
| 60 | +LABEL release='1' |
| 61 | +LABEL name='intel-gpu-fakedev' |
| 62 | +LABEL summary='Fake device file generator for Intel® GPU plugin' |
| 63 | +LABEL description='Fake device file generator provides fake sysfs+devfs content for Intel GPU plugin from its initcontainer, for scalability testing' |
0 commit comments