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
Copy file name to clipboardExpand all lines: README.md
+34-3Lines changed: 34 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,17 +19,43 @@ The initial release of the OS Image Composer tool has been tested and validated
19
19
20
20
Build the OS Image Composer command-line utility by using Go directly or by using the Earthly framework:
21
21
22
+
#### Development Build (Go)
23
+
24
+
For development and testing purposes, you can use Go directly:
25
+
22
26
```bash
23
27
# Build the tool:
24
28
go build -buildmode=pie -ldflags "-s -w" ./cmd/os-image-composer
25
29
26
30
# Or run it directly:
27
31
go run ./cmd/os-image-composer --help
28
32
```
29
-
Using the Earthly framework produces a reproducible build that automatically includes the version number (from the `--version` parameter), the build date (the current UTC date), and the Git commit SHA (current repository commit).
33
+
34
+
**Note**: Development builds using `go build` will show default version information (e.g., `Version: 0.1.0`, `Build Date: unknown`). This is expected during development.
35
+
36
+
To include version information in a development build, use ldflags with git commands:
For production and release builds, use the Earthly framework, which produces a reproducible build that automatically includes the version number (from git tags), the build date (the current UTC date), and the Git commit SHA:
56
+
57
+
```bash
58
+
# Default build (uses latest git tag for version)
33
59
earthly +build
34
60
35
61
# Build with specific version:
@@ -328,12 +354,17 @@ The `os-image-composer validate` command is useful for verifying template config
328
354
329
355
#### version
330
356
331
-
Displays the tool’s version number, build date, and Git commit SHA:
357
+
Displays the tool's version number, build date, and Git commit SHA:
332
358
333
359
```bash
334
360
./os-image-composer version
335
361
```
336
362
363
+
**Note**: The version information depends on how the binary was built:
364
+
-**Earthly build** (`earthly +build`): Shows actual version from git tags, build date, and commit SHA
365
+
-**Simple Go build** (`go build`): Shows default development values unless ldflags are used
366
+
- For production releases, always use the Earthly build or equivalent build system that injects version information
367
+
337
368
#### install-completion
338
369
339
370
Installs the shell completion feature for your current shell or a specified shell:
0 commit comments