mirror of
https://github.com/apple/container.git
synced 2026-09-23 16:15:37 +00:00
Move to TOML configuration for defaults (#1425)
- Discussion topic #1336. - This change migrates away from using `UserDefaults`, instead providing a TOML configuration mechanism for user configurable settings. All existing system property settings keys are supported in the new configuration file. However, users will have to migrate any settings they have configured in the `UserDefaults` into TOML for these settings to take effect. - Breaking changes: * `container system property get` is removed in favor of users directly utilizing `container system property list --format toml | jq<>`. * `container system property set` is removed since the TOML configuration is effectively immutable during the lifetime of the `container` daemon. Uses can edit the TOML they have in their home directory, however no changes will take effect until the daemon is restarted via `container system stop && container system start` * `container system property list --format table` is removed as generating tabular format is non-trivial and the new TOML format is intended to be human readable
This commit is contained in:
@@ -85,7 +85,7 @@ container run [<options>] <image> [<arguments> ...]
|
||||
- `10.*.*.*`
|
||||
- `192.168.*.*`
|
||||
- `172.16.*.*` through `172.31.*.*`
|
||||
- The host ends with the machine's default container DNS domain (as defined in `DefaultsStore.Keys.defaultDNSDomain`, located [here](../Sources/ContainerPersistence/DefaultsStore.swift))
|
||||
- The host ends with the machine's default container DNS domain (as defined in `DNSConfig.defaultDomain`, located [here](../Sources/ContainerPersistence/ContainerSystemConfig.swift))
|
||||
|
||||
For internal/local registries, the client uses **HTTP**. Otherwise, it uses **HTTPS**.
|
||||
|
||||
@@ -1213,118 +1213,25 @@ container system kernel set [--arch <arch>] [--binary <binary>] [--force] [--rec
|
||||
|
||||
### `container system property list (ls)`
|
||||
|
||||
Lists all available system properties with their current values, types, and descriptions. Output can be formatted as a table or JSON.
|
||||
Lists all system properties with their current values. Output can be formatted as JSON or TOML.
|
||||
|
||||
**Usage**
|
||||
|
||||
```bash
|
||||
container system property list [--format <format>] [--quiet] [--debug]
|
||||
container system property list [--format <format>] [--debug]
|
||||
```
|
||||
|
||||
**Options**
|
||||
|
||||
* `--format <format>`: Format of the output (values: json, table; default: table)
|
||||
* `-q, --quiet`: Only output the property ID
|
||||
* `--format <format>`: Format of the output (values: json, toml; default: toml)
|
||||
|
||||
**Examples**
|
||||
|
||||
```bash
|
||||
# list all properties in table format
|
||||
# list all properties in TOML format (default)
|
||||
container system property list
|
||||
|
||||
# get only property IDs
|
||||
container system property list --quiet
|
||||
|
||||
# output as JSON for scripting
|
||||
container system property list --format json
|
||||
```
|
||||
|
||||
### `container system property get`
|
||||
|
||||
Retrieves the current value of a specific system property by its ID.
|
||||
|
||||
**Usage**
|
||||
|
||||
```bash
|
||||
container system property get [--debug] <id>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
* `<id>`: The property ID
|
||||
|
||||
**Options**
|
||||
|
||||
No options.
|
||||
|
||||
**Examples**
|
||||
|
||||
```bash
|
||||
# get the default registry domain
|
||||
container system property get registry.domain
|
||||
|
||||
# get the current DNS domain setting
|
||||
container system property get dns.domain
|
||||
```
|
||||
|
||||
### `container system property set`
|
||||
|
||||
Sets the value of a system property. The command validates the value based on the property type (boolean, domain name, image reference, URL, or CIDR address).
|
||||
|
||||
**Usage**
|
||||
|
||||
```bash
|
||||
container system property set [--debug] <id> <value>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
* `<id>`: The property ID
|
||||
* `<value>`: The property value
|
||||
|
||||
**Options**
|
||||
|
||||
No options.
|
||||
|
||||
**Examples**
|
||||
|
||||
```bash
|
||||
# enable Rosetta for AMD64 builds on ARM64
|
||||
container system property set build.rosetta true
|
||||
|
||||
# set a custom DNS domain
|
||||
container system property set dns.domain mycompany.local
|
||||
|
||||
# configure a custom registry
|
||||
container system property set registry.domain registry.example.com
|
||||
|
||||
# set a custom builder image
|
||||
container system property set image.builder myregistry.com/custom-builder:latest
|
||||
```
|
||||
|
||||
### `container system property clear`
|
||||
|
||||
Clears (unsets) a system property, reverting it to its default value.
|
||||
|
||||
**Usage**
|
||||
|
||||
```bash
|
||||
container system property clear [--debug] <id>
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
* `<id>`: The property ID
|
||||
|
||||
**Options**
|
||||
|
||||
No options.
|
||||
|
||||
**Examples**
|
||||
|
||||
```bash
|
||||
# clear custom DNS domain (revert to default)
|
||||
container system property clear dns.domain
|
||||
|
||||
# clear custom registry setting
|
||||
container system property clear registry.domain
|
||||
|
||||
Reference in New Issue
Block a user