Zudoku
unikraft images

unikraft images build

Build a Unikraft project into a container image.

Code
unikraft images build [<input>] [flags]

Examples

Build the project in the current directory:

TerminalCode
unikraft image build .

Build and publish an image from a Kraftfile:

TerminalCode
unikraft image build . --output my-org/my-app:latest

Build from a Dockerfile without a Kraftfile:

TerminalCode
unikraft image build ./Dockerfile --arch x86_64 --output my-org/my-app:latest

Build with custom build arguments:

TerminalCode
unikraft image build ./app --build-arg VERSION=1.2.3 --build-arg COMMIT=abc123

Build with secret and SSH access:

TerminalCode
unikraft image build . --secret id=npm,src=$HOME/.npmrc --ssh default=$SSH_AUTH_SOCK

Build for arm64 and publish the image:

TerminalCode
unikraft image build . --arch arm64 --output my-org/my-app:latest

Build and save to a local OCI archive:

TerminalCode
unikraft image build . --output ./dist/my-app.oci.tar

Options

Code
--arch ARCH Only build the Kraftfile targets of these architectures. Defaults to every declared target. Required when the project declares no targets and no runtime, such as a bare Dockerfile. --build-arg BUILD-ARG Set build-time variables. --insecure INSECURE Allow insecure (HTTP/unverified TLS) connections to registries. Specify hostnames to restrict, or omit to apply to all. --no-cache Do not use cache when building the image. -o, --output OUTPUT Output destination --secret SECRET Secret to expose to the build (format: "id=mysecret[,src=/local/secret]"). --ssh SSH SSH agent socket or keys to expose to the build (format: "default|<id>[=<socket>|<key>[,<key>]]").

Options inherited from parent commands

Code
--config file Path to the configuration file. --log-level level Set the logging level. (default info) --log-type type Set the log type. (default text) --profile name Set the current profile. --telemetry Toggle usage analytics. (default true) --timeout duration Set a deadline for the command (e.g. 30s, 5m, 1h).

See Also

Last modified on