1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-31 04:04:51 +00:00

Fix to report the correct version inside container.

- Used build args to pass the correct version.
This commit is contained in:
Balaji Subramaniam 2016-12-09 11:32:39 -08:00
parent b44b0549bd
commit d527d588f3
2 changed files with 5 additions and 3 deletions

View file

@ -30,13 +30,14 @@ ADD . /go/src/github.com/kubernetes-incubator/node-feature-discovery
WORKDIR /go/src/github.com/kubernetes-incubator/node-feature-discovery
ARG NFD_VERSION
RUN git clone --depth 1 https://github.com/01org/intel-cmt-cat.git
RUN cd intel-cmt-cat/lib; make install
RUN cd rdt-discovery; make
RUN go get github.com/Masterminds/glide
RUN glide install
RUN go install \
-ldflags "-s -w -X main.version=`git describe --tags --dirty --always`" \
-ldflags "-s -w -X main.version=$NFD_VERSION" \
github.com/kubernetes-incubator/node-feature-discovery
ENTRYPOINT ["/go/bin/node-feature-discovery"]

View file

@ -9,6 +9,7 @@ VERSION := $(shell git describe --tags --dirty --always)
all: docker
# To override QUAY_REGISTRY_USER use the -e option as follows:
# QUAY_REGISTRY_USER=<my-username> make docker -e
# QUAY_REGISTRY_USER=<my-username> make docker -e.
docker:
docker build -t $(QUAY_DOMAIN_NAME)/$(QUAY_REGISTRY_USER)/$(DOCKER_IMAGE_NAME):$(VERSION) ./
docker build --build-arg NFD_VERSION=$(VERSION) \
-t $(QUAY_DOMAIN_NAME)/$(QUAY_REGISTRY_USER)/$(DOCKER_IMAGE_NAME):$(VERSION) ./