Skip to content

Commit

Permalink
Fix to report the correct version inside container.
Browse files Browse the repository at this point in the history
- Used build args to pass the correct version.
  • Loading branch information
Balaji Subramaniam committed Dec 9, 2016
1 parent b44b054 commit d527d58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) ./

0 comments on commit d527d58

Please sign in to comment.