1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

Configurable image build tool

Make it possible to specify an image build tool other than docker - a
limitation is that the build tool must be compatible with docker files,
of course. This makes it possible to build an NFD image without the
Docker daemon, for example.

The image build command is specified in a makefile variable and can be
overridden from command line, for example:
$ make IMAGE_BUILD_CMD="buildah bud"

Thanks: Zvonko Kosic for suggesting this
This commit is contained in:
Markus Lehtonen 2018-09-12 16:40:56 +03:00
parent db929b878b
commit ed5a259eaa
2 changed files with 13 additions and 6 deletions

View file

@ -1,17 +1,19 @@
.PHONY: all
IMAGE_BUILD_CMD := docker build
QUAY_DOMAIN_NAME := quay.io
QUAY_REGISTRY_USER := kubernetes_incubator
DOCKER_IMAGE_NAME := node-feature-discovery
VERSION := $(shell git describe --tags --dirty --always)
all: docker
all: image
# To override QUAY_REGISTRY_USER use the -e option as follows:
# QUAY_REGISTRY_USER=<my-username> make docker -e.
docker:
docker build --build-arg NFD_VERSION=$(VERSION) \
image:
$(IMAGE_BUILD_CMD) --build-arg NFD_VERSION=$(VERSION) \
--build-arg http_proxy=$(http_proxy) \
--build-arg HTTP_PROXY=$(HTTP_PROXY) \
--build-arg https_proxy=$(https_proxy) \

View file

@ -224,7 +224,7 @@ Download the source code.
git clone https://github.com/kubernetes-incubator/node-feature-discovery
```
**Build the Docker image:**
**Build the container image:**
```
cd <project-root>
@ -233,9 +233,14 @@ make
**NOTE: Our default docker image is hosted in quay.io. To override the
`QUAY_REGISTRY_USER` use the `-e` option as follows:
`QUAY_REGISTRY_USER=<my-username> make docker -e`**
`QUAY_REGISTRY_USER=<my-username> make image -e`**
Push the Docker Image (optional)
You can also specify a build tool different from Docker, for example:
```
make IMAGE_BUILD_CMD="buildah bud"
```
Push the container image (optional, this example with Docker)
```
docker push <quay-domain-name>/<registry-user>/<image-name>:<version>