Creates a new and optimized server image.

Usage:

kc.sh build [OPTIONS]

Creates a new and optimized server image based on the configuration options
passed to this command. Once created, the configuration will be persisted and
read during startup without having to pass them over again.

Consider running this command before running the server in production for an
optimal runtime.

Options:

-h, --help           This help message.
--help-all           This same help message but with additional options.
-v, --verbose        Print out error details when running this command.

Database:

--db <vendor>        The database vendor. In production mode the default value of 'dev-file' is
                       deprecated, you should explicitly specify the db instead. Possible values
                       are: dev-file, dev-mem, mariadb, mssql, mysql, oracle, postgres, tidb.
                       Default: dev-file.
--db-driver <driver> The fully qualified class name of the JDBC driver. If not set, a default
                       driver is set accordingly to the chosen database.

Database - additional datasources:

--db-driver-<datasource> <driver>
                     Used for named <datasource>. The fully qualified class name of the JDBC
                       driver. If not set, a default driver is set accordingly to the chosen
                       database.
--db-kind-<datasource> <vendor>
                     Used for named <datasource>. The database vendor. In production mode the
                       default value of 'dev-file' is deprecated, you should explicitly specify the
                       db instead. Possible values are: dev-file, dev-mem, mariadb, mssql, mysql,
                       oracle, postgres, tidb.

Transaction:

--transaction-xa-enabled <true|false>
                     If set to true, XA datasources will be used. Default: false.
--transaction-xa-enabled-<datasource> <true|false>
                     If set to true, XA for <datasource> datasource will be used. Default: true.

Feature:

--feature-<name> <enabled|disabled|vX(X is version)>
                     Enable/Disable specific feature <feature>. It takes precedence over the
                       'features', and 'features-disabled' options. Possible values are: 'enabled',
                       'disabled', or specific version (lowercase) that will be enabled (f.e. 'v2')
--features <feature> Enables a set of one or more features. Possible values are: <...>.
--features-disabled <feature>
                     Disables a set of one or more features. Possible values are: <...>.

HTTP(S):

--http-relative-path <path>
                     Set the path relative to '/' for serving resources. The path must start with a
                       '/'. Default: /.
--https-client-auth <auth>
                     Configures the server to require/request client authentication. Possible
                       values are: none, request, required. Default: none.

Health:

--health-enabled <true|false>
                     If the server should expose health check endpoints. If enabled, health checks
                       are available at the '/health', '/health/ready' and '/health/live'
                       endpoints. Default: false.

Management:

--http-management-relative-path <path>
                     Set the path relative to '/' for serving resources from management interface.
                       The path must start with a '/'. If not given, the value is inherited from
                       HTTP options. Relevant only when something is exposed on the management
                       interface - see the guide for details. Default: /.
--https-management-client-auth <auth>
                     Configures the management interface to require/request client authentication.
                       If not given, the value is inherited from HTTP options. Relevant only when
                       something is exposed on the management interface - see the guide for
                       details. Possible values are: none, request, required. Default: none.
--legacy-observability-interface <true|false>
                     DEPRECATED. If metrics/health endpoints should be exposed on the main HTTP
                       server (not recommended). If set to true, the management interface is
                       disabled. Default: false.

Metrics:

--metrics-enabled <true|false>
                     If the server should expose metrics. If enabled, metrics are available at the
                       '/metrics' endpoint. Default: false.

Vault:

--vault <provider>   Enables a vault provider. Possible values are: file, keystore.

Logging:

--log-mdc-enabled <true|false>
                     Indicates whether to add information about the realm and other information to
                       the mapped diagnostic context. All elements will be prefixed with 'kc.'
                       Default: false. Available only when log-mdc preview feature is enabled.

Tracing:

--tracing-enabled <true|false>
                     Enables the OpenTelemetry tracing. Default: false. Available only when
                       'opentelemetry' feature is enabled.

Security:

--fips-mode <mode>   Sets the FIPS mode. If 'non-strict' is set, FIPS is enabled but on
                       non-approved mode. For full FIPS compliance, set 'strict' to run on approved
                       mode. This option defaults to 'disabled' when 'fips' feature is disabled,
                       which is by default. This option defaults to 'non-strict' when 'fips'
                       feature is enabled. Possible values are: non-strict, strict. Default:
                       disabled.

Examples:

  Change the database vendor:

      $ kc.sh build --db=postgres

  Enable a feature:

      $ kc.sh build --features=<feature_name>

  Or alternatively, enable all tech preview features:

      $ kc.sh build --features=preview

  Enable health endpoints:

      $ kc.sh build --health-enabled=true

  Enable metrics endpoints:

      $ kc.sh build --metrics-enabled=true

  Change the relative path:

      $ kc.sh build --http-relative-path=/auth
