You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For complete usage instructions, see the [CLI Specification](./image-composer-cli-specification.md).
14
39
15
40
## Get Started
16
41
@@ -46,7 +71,7 @@ The Earthly build automatically includes:
46
71
47
72
### Global Configuration
48
73
49
-
Image Composer Tool supports global configuration files to set tool-level parameters that apply across all image builds. Image-specific parameters should still be defined in the JSON specification files.
74
+
Image Composer Tool supports global configuration files to set tool-level parameters that apply across all image builds. Image-specific parameters are defined in YAML image template files.
See the [Shell Completion](#shell-completion) section for more details.
222
247
223
-
### User Input JSON
248
+
### Image Template Format
224
249
225
-
This section provides a detailed explanation of the JSON input structure used to configure and build a Linux-based operating system. The JSON format allows users to define key parameters such as the operating system distribution, version, architecture, software packages, output format, immutability, and kernel configuration. By customizing these parameters, users can create tailored Linux OS builds, including distributions like Ubuntu, Wind River, and Edge Microvisor Toolkits.
250
+
Image templates are written in YAML format and define the requirements for building a specific OS image. The template structure allows users to define key parameters such as the operating system distribution, version, architecture, software packages, output format, and kernel configuration.
226
251
227
-
```json
228
-
{
229
-
"distro": "eLxr",
230
-
"version": "12",
231
-
"arch": "x86_64",
232
-
"packages": [
233
-
"cloud-init",
234
-
"cloud-utils-growpart",
235
-
"dhcpcd",
236
-
"grubby",
237
-
"hyperv-daemons",
238
-
"netplan",
239
-
"python3",
240
-
"rsyslog",
241
-
"sgx-backwards-compatibility",
242
-
"WALinuxAgent",
243
-
"wireless-regdb"
244
-
],
245
-
"immutable": true,
246
-
"output": "iso",
247
-
"kernel": {
248
-
"version": "5.10.0",
249
-
"cmdline": "quiet splash"
250
-
}
251
-
}
252
+
```yaml
253
+
image:
254
+
name: azl3-x86_64-edge
255
+
version: "1.0.0"
256
+
257
+
target:
258
+
os: azure-linux # Target OS name
259
+
dist: azl3 # Target OS distribution
260
+
arch: x86_64 # Target OS architecture
261
+
imageType: raw # Image type: raw, iso, img, vhd
262
+
263
+
systemConfigs:
264
+
- name: edge
265
+
description: Default configuration for edge image
266
+
267
+
# Package Configuration
268
+
packages:
269
+
# Additional packages beyond the base system
270
+
- openssh-server # Remote access
271
+
- docker-ce # Container runtime
272
+
- vim # Text editor
273
+
- curl # HTTP client
274
+
- wget # File downloader
275
+
276
+
# Kernel Configuration
277
+
kernel:
278
+
version: "6.12"
279
+
cmdline: "quiet splash"
252
280
```
253
281
254
282
#### Key Components
255
283
256
-
##### 1. `distro`
257
-
258
-
**Description:** Specifies the target Linux distribution to be built.
259
-
**Examples:**
260
-
261
-
-`AzureLinux`
262
-
-`eLxr`
263
-
264
-
##### 2. `version`
265
-
266
-
**Description:** Defines the version of the target operating system.
267
-
**Example:**`"12"`
284
+
##### 1. `image`
268
285
269
-
##### 3. `arch`
286
+
**Description:** Basic image identification and metadata.
287
+
- `name`: Name of the resulting image
288
+
- `version`: Version for tracking and naming
270
289
271
-
**Description:** Specifies the architecture of the target operating system.
272
-
**Examples:**
290
+
##### 2. `target`
273
291
274
-
-`x86_64`
275
-
-`arm64`
292
+
**Description:** Defines the target OS and image configuration.
293
+
- `os`: Target operating system (`azure-linux`, `emt`, `elxr`)
294
+
- `dist`: Distribution identifier (`azl3`, `emt3`, `elxr12`)
- `imageType`: Output format (`raw`, `iso`, `img`, `vhd`)
276
297
277
-
##### 4. `packages`
298
+
##### 3. `systemConfigs`
278
299
279
-
**Description:** A list of software packages to be included in the OS build. These packages will be pre-installed in the resulting image.
280
-
**Examples:**
300
+
**Description:** Array of system configurations that define what goes into the image.
301
+
- `name`: Configuration name
302
+
- `description`: Human-readable description
303
+
- `packages`: List of packages to include in the OS build
304
+
- `kernel`: Kernel configuration with version and command-line parameters
281
305
282
-
-`cloud-init`: Used for initializing cloud instances.
283
-
-`python3`: The Python 3 programming language interpreter.
284
-
-`rsyslog`: A logging system for Linux.
306
+
#### Supported Distributions
285
307
286
-
##### 5. `immutable`
308
+
| OS | Distribution | Version | Provider |
309
+
|----|-------------|---------|----------|
310
+
| azure-linux | azl3 | 3 | AzureLinux3 |
311
+
| emt | emt3 | 3.0 | EMT3.0 |
312
+
| elxr | elxr12 | 12 | eLxr12 |
287
313
288
-
**Description:** Indicates whether the operating system should be immutable.
289
-
**Values:**
314
+
#### Package Examples
290
315
291
-
-`true`: The OS is immutable, meaning it cannot be modified after creation.
292
-
-`false`: The OS is mutable, allowing modifications after creation.
316
+
Common packages that can be included:
317
+
- `cloud-init`: Used for initializing cloud instances
318
+
- `python3`: The Python 3 programming language interpreter
319
+
- `rsyslog`: A logging system for Linux
320
+
- `openssh-server`: SSH server for remote access
321
+
- `docker-ce`: Docker container runtime
293
322
294
-
##### 6. `output`
323
+
The image template format is validated against a JSON schema to ensure correctness before building.
295
324
296
-
**Description:** Specifies the format of the output build.
297
-
**Values:**
325
+
### Legacy JSON Format
298
326
299
-
-`iso`: The OS will be built as an ISO file, suitable for installation or booting.
300
-
-`raw`: The OS will be built as a raw disk image, useful for direct disk writing.
301
-
-`vhd`: The OS will be built as a VHD (Virtual Hard Disk) file, commonly used in virtual environments.
327
+
**Note:** The tool previously supported JSON build specifications but now exclusively uses YAML image templates. The JSON format has been removed to simplify the architecture and improve maintainability.
302
328
303
-
##### 7. `kernel`
329
+
For reference, the old JSON format looked like this:
304
330
305
-
**Description:** Defines the kernel version and allows customization of the kernel command line.
306
-
**Attributes:**
307
-
308
-
-`version`: Specifies the kernel version to be used.
0 commit comments