Skip to content

Commit 53515f9

Browse files
committed
[confcom] update help text and README
1 parent fa1c0e2 commit 53515f9

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

src/confcom/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ The `confcom` extension does not currently support:
6060
- Variables and Parameters with non-primitive data types e.g. objects and arrays
6161
- Nested and Linked ARM Templates
6262

63+
## Platform Support (Linux and Windows Policies)
64+
65+
The `--platform` parameter controls whether policies are generated for Linux (`linux/amd64`, the default) or Windows (`windows/amd64`) containers.
66+
67+
**Docker Desktop must be running in the matching container mode** to produce correct layer hashes:
68+
69+
| Policy Target | Docker Container Mode | Where to Run |
70+
|---|---|---|
71+
| Linux (`--platform linux/amd64`) | Linux containers | WSL or PowerShell |
72+
| Windows (`--platform windows/amd64`) | Windows containers | PowerShell only |
73+
74+
- **Windows policies cannot be generated from WSL**, because Windows layer hashing (CIMfs) requires Windows APIs.
75+
- **Linux policies can be generated from either WSL or PowerShell**, as long as Docker Desktop is in Linux containers mode.
76+
- Running with the wrong Docker container mode may produce **incorrect layer hashes** that will cause the container to be rejected at runtime.
77+
6378
## Trademarks
6479

6580
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft

src/confcom/azext_confcom/_help.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@
105105
type: boolean
106106
short-summary: 'When enabled, the default fragments are not included in the generated policy. This includes containers needed to mount azure files, mount secrets, mount git repos, and other common ACI features'
107107
108+
- name: --platform
109+
type: string
110+
short-summary: 'Target platform for policy generation (linux/amd64 or windows/amd64). Defaults to linux/amd64. Docker Desktop must be running in the matching container mode to produce correct layer hashes.'
111+
108112
examples:
109113
- name: Input an ARM Template file to inject a base64 encoded Confidential Container Security Policy into the ARM Template
110114
text: az confcom acipolicygen --template-file "./template.json"
@@ -116,6 +120,8 @@
116120
text: az confcom acipolicygen --template-file "./template.json" --tar "./image.tar"
117121
- name: Input an ARM Template file and use a fragments JSON file to generate a policy
118122
text: az confcom acipolicygen --template-file "./template.json" --fragments-json "./fragments.json" --include-fragments
123+
- name: Generate a Windows container policy (requires Docker Desktop in Windows containers mode)
124+
text: az confcom acipolicygen --template-file "./template.json" --platform windows/amd64 --outraw-pretty-print
119125
"""
120126

121127
helps[

src/confcom/azext_confcom/_params.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ def load_arguments(self, _):
119119
options_list=("--platform",),
120120
required=False,
121121
default="linux/amd64",
122-
help="Target platform for policy generation. Defaults to linux/amd64.",
122+
help="Target platform for policy generation. Defaults to linux/amd64. "
123+
"Note: Docker Desktop must be running in the matching container mode "
124+
"(Linux containers for linux/amd64, Windows containers for windows/amd64) "
125+
"to produce correct layer hashes.",
123126
choices=["linux/amd64", "windows/amd64"],
124127
)
125128
c.argument(

0 commit comments

Comments
 (0)