initial buildroot for linux 5.15
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
config BR2_TARGET_ROOTFS_OCI
|
||||
bool "oci image"
|
||||
help
|
||||
Build an OCI (Open Container Initiative) image.
|
||||
|
||||
By default, the image is generated in a directory called
|
||||
rootfs-oci:
|
||||
|
||||
$ cd output/images
|
||||
$ ls rootfs-oci/
|
||||
blobs index.json oci-layout
|
||||
|
||||
You can push the image to a registry. Example using skopeo:
|
||||
|
||||
$ skopeo copy --dest-creds <user>:<pass> \
|
||||
oci:rootfs-oci:<tag> docker://<user>/<image>[:tag]
|
||||
|
||||
And pull/run it with docker:
|
||||
|
||||
$ docker run -it <user>/<image>[:tag]
|
||||
|
||||
if BR2_TARGET_ROOTFS_OCI
|
||||
|
||||
config BR2_TARGET_ROOTFS_OCI_AUTHOR
|
||||
string "author name and/or email address"
|
||||
default "Buildroot"
|
||||
help
|
||||
Name and/or email address of the person which created the
|
||||
image.
|
||||
|
||||
config BR2_TARGET_ROOTFS_OCI_TAG
|
||||
string "image tag"
|
||||
default "latest"
|
||||
help
|
||||
Tag to be used in the container image. If empty, 'latest' will
|
||||
be used by default.
|
||||
|
||||
config BR2_TARGET_ROOTFS_OCI_ENTRYPOINT
|
||||
string "entrypoint"
|
||||
default "sh"
|
||||
help
|
||||
Command to execute when the container starts.
|
||||
|
||||
config BR2_TARGET_ROOTFS_OCI_ENTRYPOINT_ARGS
|
||||
string "entrypoint arguments"
|
||||
help
|
||||
Default arguments to the entrypoint of the container.
|
||||
|
||||
config BR2_TARGET_ROOTFS_OCI_WORKDIR
|
||||
string "working directory"
|
||||
help
|
||||
Working directory of the entrypoint process in the
|
||||
container.
|
||||
|
||||
config BR2_TARGET_ROOTFS_OCI_UID
|
||||
string "username or UID"
|
||||
default "0"
|
||||
help
|
||||
The username or UID of user the process run as.
|
||||
|
||||
config BR2_TARGET_ROOTFS_OCI_ENV_VARS
|
||||
string "environment variables"
|
||||
help
|
||||
Default environment variables for the container.
|
||||
Space-separated list of variable=value assignments.
|
||||
|
||||
config BR2_TARGET_ROOTFS_OCI_PORTS
|
||||
string "ports"
|
||||
help
|
||||
Default set of ports to expose from a container running
|
||||
this image as a space-separted list of ports in the following
|
||||
format:
|
||||
|
||||
<port>/tcp, <port>/udp, <port> (same as <port>/tcp).
|
||||
|
||||
config BR2_TARGET_ROOTFS_OCI_LABELS
|
||||
string "labels"
|
||||
help
|
||||
Metadata in the format KEY=VALUE for the container compliant
|
||||
with OCI annotation rules. If KEY starts with a dot, it will
|
||||
be prefixed with "org.opencontainers.image"
|
||||
(e.g. .url -> org.opencontainers.image.url).
|
||||
|
||||
config BR2_TARGET_ROOTFS_OCI_ARCHIVE
|
||||
bool "pack oci image into a tar archive"
|
||||
help
|
||||
Select whether the image should be packed into a TAR archive.
|
||||
|
||||
endif
|
||||
@@ -0,0 +1,80 @@
|
||||
################################################################################
|
||||
#
|
||||
# Build the oci image
|
||||
#
|
||||
################################################################################
|
||||
|
||||
ROOTFS_OCI_DEPENDENCIES = host-sloci-image
|
||||
|
||||
# architecture - take it from Go
|
||||
OCI_SLOCI_IMAGE_OPTS = --arch $(GO_GOARCH)
|
||||
|
||||
# architecture variant (typically used only for arm)
|
||||
OCI_SLOCI_IMAGE_OPTS += $(and $(GO_GOARM),--arch-variant v$(GO_GOARM))
|
||||
|
||||
# entrypoint
|
||||
OCI_ENTRYPOINT = $(call qstrip,$(BR2_TARGET_ROOTFS_OCI_ENTRYPOINT))
|
||||
ifneq ($(OCI_ENTRYPOINT),)
|
||||
OCI_SLOCI_IMAGE_OPTS += --entrypoint "$(OCI_ENTRYPOINT)"
|
||||
endif
|
||||
|
||||
# entrypoint arguments
|
||||
OCI_ENTRYPOINT_ARGS = $(call qstrip,$(BR2_TARGET_ROOTFS_OCI_ENTRYPOINT_ARGS))
|
||||
ifneq ($(OCI_ENTRYPOINT_ARGS),)
|
||||
OCI_SLOCI_IMAGE_OPTS += --cmd "$(OCI_ENTRYPOINT_ARGS)"
|
||||
endif
|
||||
|
||||
# author
|
||||
OCI_AUTHOR = $(call qstrip,$(BR2_TARGET_ROOTFS_OCI_AUTHOR))
|
||||
ifneq ($(OCI_AUTHOR),)
|
||||
OCI_SLOCI_IMAGE_OPTS += --author "$(OCI_AUTHOR)"
|
||||
endif
|
||||
|
||||
# username or UID
|
||||
OCI_UID = $(call qstrip,$(BR2_TARGET_ROOTFS_OCI_UID))
|
||||
ifneq ($(OCI_UID),)
|
||||
OCI_SLOCI_IMAGE_OPTS += --user "$(OCI_UID)"
|
||||
endif
|
||||
|
||||
# labels
|
||||
OCI_LABELS = $(call qstrip,$(BR2_TARGET_ROOTFS_OCI_LABELS))
|
||||
ifneq ($(OCI_LABELS),)
|
||||
OCI_SLOCI_IMAGE_OPTS += \
|
||||
$(foreach label,$(OCI_LABELS),--label "$(label)")
|
||||
endif
|
||||
|
||||
# environment variables
|
||||
OCI_ENV_VARS = $(call qstrip,$(BR2_TARGET_ROOTFS_OCI_ENV_VARS))
|
||||
ifneq ($(OCI_ENV_VARS),)
|
||||
OCI_SLOCI_IMAGE_OPTS += \
|
||||
$(foreach var,$(OCI_ENV_VARS),--env "$(var)")
|
||||
endif
|
||||
|
||||
# working directory
|
||||
OCI_WORKDIR = $(call qstrip,$(BR2_TARGET_ROOTFS_OCI_WORKDIR))
|
||||
ifneq ($(OCI_WORKDIR),)
|
||||
OCI_SLOCI_IMAGE_OPTS += --working-dir "$(OCI_WORKDIR)"
|
||||
endif
|
||||
|
||||
# ports
|
||||
OCI_PORTS = $(call qstrip,$(BR2_TARGET_ROOTFS_OCI_PORTS))
|
||||
ifneq ($(OCI_PORTS),)
|
||||
OCI_SLOCI_IMAGE_OPTS += \
|
||||
$(foreach port,$(OCI_PORTS),--port "$(port)")
|
||||
endif
|
||||
|
||||
# tag
|
||||
OCI_TAG = $(or $(call qstrip,$(BR2_TARGET_ROOTFS_OCI_TAG)),latest)
|
||||
|
||||
# enable tar archive
|
||||
ifeq ($(BR2_TARGET_ROOTFS_OCI_ARCHIVE),y)
|
||||
OCI_SLOCI_IMAGE_OPTS += --tar
|
||||
endif
|
||||
|
||||
define ROOTFS_OCI_CMD
|
||||
rm -rf $(BINARIES_DIR)/rootfs-oci
|
||||
$(HOST_DIR)/bin/sloci-image $(OCI_SLOCI_IMAGE_OPTS) $(TARGET_DIR) \
|
||||
$(BINARIES_DIR)/rootfs-oci:$(OCI_TAG)
|
||||
endef
|
||||
|
||||
$(eval $(rootfs))
|
||||
Reference in New Issue
Block a user