kernel: Add a Dockerfile to make it easier to configure kernels

The new Dockerfile.kconfig can be used, via the 'kconfig' make target
to build a 'linuxkit/kconfig' images. This images contains the patched
source and default kernel configs for all supported kernels.

It's useful to updating the kernel config files.

While at it, also update the alpine base.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer
2017-08-21 13:38:29 +01:00
parent 6f1e4add2e
commit ba2e6a5bb8
3 changed files with 46 additions and 1 deletions

View File

@@ -49,6 +49,8 @@ COMMIT_LABEL=--label org.opencontainers.image.revision=$(REPO_COMMIT)
endif
LABELS=$(REPO_LABEL) $(COMMIT_LABEL)
KERNEL_VERSIONS=
.PHONY: check tag push
# Targets:
# fetch: Downloads the kernel sources into ./sources
@@ -76,6 +78,7 @@ define kernel
ifeq ($(3),)
sources/linux-$(1).tar.xz: Makefile | sources
curl -fsSLo sources/linux-$(1).tar.xz https://www.kernel.org/pub/linux/kernel/v4.x/linux-$(1).tar.xz
KERNEL_VERSIONS+=$(1)
endif
build_$(2)$(3): Dockerfile Makefile $(wildcard patches-$(2)/*) $(wildcard kernel_config-$(2)*) kernel_config.debug | sources
@@ -133,3 +136,9 @@ endef
$(eval $(call kernel,4.9.44,4.9.x))
$(eval $(call kernel,4.9.44,4.9.x,_dbg))
$(eval $(call kernel,4.4.83,4.4.x))
# Target for kernel config
kconfig: | sources
docker build --no-cache -f Dockerfile.kconfig \
--build-arg KERNEL_VERSIONS="$(KERNEL_VERSIONS)" \
-t linuxkit/kconfig .