3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 FROM golang:${go_version}-alpine3.9 as builder
17 MAINTAINER Ferenc Toth <ferenc.2.toth@nokia.com>
22 RUN apk add --no-cache gcc musl-dev git curl tar linux-headers \
23 && mkdir -p $GOPATH/src/github.com/intel/sriov-network-device-plugin \
24 && cd $GOPATH/src/github.com/intel \
25 && if [ -n "$SRIOVDP_HASH" ]; then \
26 git clone https://github.com/intel/sriov-network-device-plugin.git \
27 && cd sriov-network-device-plugin \
28 && git checkout $SRIOVDP_HASH; \
30 curl -fsSL https://github.com/intel/sriov-network-device-plugin/archive/v${SRIOVDP}.tar.gz | tar xz --strip-components=1 -C sriov-network-device-plugin; \
32 && go install -a -ldflags '-extldflags "-static"' github.com/intel/sriov-network-device-plugin/cmd/sriovdp
35 RUN apk add --no-cache hwdata-pci jq
37 COPY init.sh /usr/local/bin/
38 COPY --from=builder /go/bin/* /usr/local/bin/
39 RUN chmod 700 /usr/local/bin/*
42 LABEL io.k8s.display-name="SRIOV Network Device Plugin"
43 ENTRYPOINT ["/usr/local/bin/sriovdp"]