-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: Create separate kernel and module images
This commit moves the kernel image out of the flintlock/ subdir and splits the kernel image into two: one containing just the binary, the other just the module. The sequence works like so: - `builder` creates a starting point image from Ubuntu, installing packages etc. - `base` uses builder, pulls and compiles the kernel, then saves the modules and the binary in a `scratch` image. I have kept this image under the old `flintlock-kernel` name with modules and the binary to maintain backwards compatibility. - `modules` and `bin` use `base` and simply copy the things they need into a `scratch` image. The images produced are: - `kernel-builder` - `flintlock-kernel` (kept the same for backwards compatibility) - `kernel-bin` - `kernel-modules`
- Loading branch information
1 parent
942142c
commit 4baec80
Showing
12 changed files
with
72 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
DOCKER := docker | ||
|
||
REGISTRY?=ghcr.io/weaveworks-liquidmetal | ||
|
||
BUILDER_IMAGE_NAME?=kernel-builder | ||
BASE_IMAGE_NAME?=flintlock-kernel | ||
BIN_IMAGE_NAME?=kernel-bin | ||
MOD_IMAGE_NAME?=kernel-modules | ||
|
||
KERNEL_VERSIONS ?= 4.19.215 5.10.77 # If you update this list, please remember to update the matrix in the kernel-images.yml github action! | ||
|
||
all: build | ||
|
||
builder: | ||
$(DOCKER) build -t $(BUILDER_IMAGE_NAME):dev \ | ||
-f builder/Dockerfile . | ||
|
||
build: $(addprefix build-,$(KERNEL_VERSIONS)) | ||
build-%: builder | ||
$(MAKE) base-$* | ||
$(MAKE) binary-$* | ||
$(MAKE) modules-$* | ||
base-%: | ||
$(DOCKER) build -t $(BASE_IMAGE_NAME):$* \ | ||
--build-arg KERNEL_VERSION=$* \ | ||
--build-arg IMAGE_NAME=$(BUILDER_IMAGE_NAME) \ | ||
-f base/Dockerfile . | ||
binary-%: | ||
$(DOCKER) build -t $(BIN_IMAGE_NAME):$* \ | ||
--build-arg IMAGE_NAME=$(BASE_IMAGE_NAME):$* \ | ||
-f bin/Dockerfile . | ||
modules-%: | ||
$(DOCKER) build -t $(MOD_IMAGE_NAME):$* \ | ||
--build-arg IMAGE_NAME=$(BASE_IMAGE_NAME):$* \ | ||
-f modules/Dockerfile . | ||
|
||
push: $(addprefix push-,$(KERNEL_VERSIONS)) | ||
push-%: | ||
$(DOCKER) push $(REGISTRY)/$(BASE_IMAGE_NAME):$* | ||
$(DOCKER) push $(REGISTRY)/$(BIN_IMAGE_NAME):$* | ||
$(DOCKER) push $(REGISTRY)/$(MOD_IMAGE_NAME):$* |
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ARG IMAGE_NAME | ||
FROM ${IMAGE_NAME} AS builder | ||
FROM scratch | ||
|
||
COPY --from=builder /boot /boot |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ARG IMAGE_NAME | ||
FROM ${IMAGE_NAME} AS builder | ||
FROM scratch | ||
|
||
COPY --from=builder /lib/modules /lib/modules |