forked from intel/intel-ethernet-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.labeler
More file actions
38 lines (28 loc) · 1.22 KB
/
Dockerfile.labeler
File metadata and controls
38 lines (28 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2021 Intel Corporation
FROM golang:alpine3.16 as builder
WORKDIR /workspace
COPY go.mod go.sum ./
RUN go mod download
COPY cmd cmd/
COPY pkg pkg/
COPY apis apis/
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o node_labeler cmd/labeler/main.go
RUN apk update && apk add --no-cache curl=7.83.1-r4
RUN curl https://pci-ids.ucw.cz/v2.2/pci.ids.gz -o pci.ids.gz && gunzip pci.ids.gz
FROM registry.access.redhat.com/ubi9/ubi-micro:9.1.0-6
ARG VERSION
### Required OpenShift Labels
LABEL name="Intel® Ethernet Operator discovery container" \
vendor="Intel Corporation" \
version=$VERSION \
release="1" \
summary="Intel® Ethernet Operator discovery container labels kubernetes nodes that contain the PCI \
devices as set in the config file (typically Intel Ethernet E810)" \
description="The container detects the relevant PCI devices, labels the nodes that contain them \
and removes the label for the nodes that do not."
COPY --from=builder /workspace/pci.ids /usr/share/misc/pci.ids
USER 1001
WORKDIR /labeler-workspace
COPY --from=builder /workspace/node_labeler .
ENTRYPOINT ["bash", "-c", "/labeler-workspace/node_labeler && sleep infinity"]