container-source-policy-windows-arm64 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -6
- package/bin/container-source-policy.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,24 +87,28 @@ container-source-policy completion zsh
|
|
|
87
87
|
|
|
88
88
|
## What gets pinned
|
|
89
89
|
|
|
90
|
-
### Container images (`FROM`)
|
|
90
|
+
### Container images (`FROM`, `COPY --from`, `ONBUILD`)
|
|
91
91
|
|
|
92
|
-
- Looks at `FROM
|
|
92
|
+
- Looks at `FROM …`, `COPY --from=<image>`, and their `ONBUILD` variants across all provided Dockerfiles.
|
|
93
93
|
- Skips:
|
|
94
94
|
- `FROM scratch`
|
|
95
|
-
- `FROM <stage>` references to a previous named build stage
|
|
96
|
-
- `
|
|
95
|
+
- `FROM <stage>` / `COPY --from=<stage>` references to a previous named build stage
|
|
96
|
+
- `COPY --from=0` numeric stage indices
|
|
97
|
+
- `FROM ${VAR}` / `COPY --from=${VAR}` (unexpanded ARG/ENV variables)
|
|
97
98
|
- images already written as `name@sha256:…`
|
|
98
99
|
- Resolves the image manifest digest from the registry and emits BuildKit `CONVERT` rules of the form:
|
|
99
100
|
- `docker-image://<as-written-in-Dockerfile>` → `docker-image://<normalized>@sha256:…`
|
|
100
101
|
|
|
101
|
-
### HTTP sources (`ADD`)
|
|
102
|
+
### HTTP sources (`ADD`, `ONBUILD ADD`)
|
|
102
103
|
|
|
103
|
-
- Looks at `ADD <url> …` instructions with HTTP/HTTPS URLs.
|
|
104
|
+
- Looks at `ADD <url> …` and `ONBUILD ADD <url> …` instructions with HTTP/HTTPS URLs.
|
|
104
105
|
- Skips:
|
|
105
106
|
- `ADD --checksum=… <url>` (already pinned)
|
|
106
107
|
- URLs containing unexpanded variables (`${VAR}`, `$VAR`)
|
|
108
|
+
- Git URLs (handled separately, see below)
|
|
109
|
+
- Volatile content (emits warning): URLs returning `Cache-Control: no-store`, `no-cache`, `max-age=0`, or expired `Expires` headers
|
|
107
110
|
- Fetches the checksum and emits `CONVERT` rules with `http.checksum` attribute.
|
|
111
|
+
- **Respects `Vary` header**: captures request headers that affect response content (e.g., `User-Agent`, `Accept-Encoding`) and includes them in the policy as `http.header.*` attributes to ensure reproducible builds.
|
|
108
112
|
|
|
109
113
|
**Optimized checksum fetching** — avoids downloading large files when possible:
|
|
110
114
|
- `raw.githubusercontent.com`: extracts SHA256 from ETag header
|
|
@@ -112,6 +116,20 @@ container-source-policy completion zsh
|
|
|
112
116
|
- S3: uses `x-amz-checksum-sha256` response header (by sending `x-amz-checksum-mode: ENABLED`)
|
|
113
117
|
- Fallback: downloads and computes SHA256
|
|
114
118
|
|
|
119
|
+
### Git sources (`ADD`, `ONBUILD ADD`)
|
|
120
|
+
|
|
121
|
+
- Looks at `ADD <git-url> …` and `ONBUILD ADD <git-url> …` instructions with Git repository URLs.
|
|
122
|
+
- Supports various Git URL formats:
|
|
123
|
+
- `https://github.com/owner/repo.git#ref`
|
|
124
|
+
- `git://host/path#ref`
|
|
125
|
+
- `git@github.com:owner/repo#ref`
|
|
126
|
+
- `ssh://git@host/path#ref`
|
|
127
|
+
- Skips URLs containing unexpanded variables (`${VAR}`, `$VAR`)
|
|
128
|
+
- Uses `git ls-remote` to resolve the ref (branch, tag, or commit) to a commit SHA
|
|
129
|
+
- Emits `CONVERT` rules with `git.checksum` attribute (full 40-character commit SHA)
|
|
130
|
+
|
|
131
|
+
Example: `ADD https://github.com/cli/cli.git#v2.40.0 /dest` pins to commit `54d56cab...`
|
|
132
|
+
|
|
115
133
|
## Development
|
|
116
134
|
|
|
117
135
|
```bash
|
|
@@ -132,6 +150,7 @@ UPDATE_SNAPS=true go test ./internal/integration/...
|
|
|
132
150
|
- `internal/dockerfile`: Dockerfile parsing (`FROM` and `ADD` extraction)
|
|
133
151
|
- `internal/registry`: registry client (image digest resolution)
|
|
134
152
|
- `internal/http`: HTTP client (URL checksum fetching with optimizations)
|
|
153
|
+
- `internal/git`: Git client (commit SHA resolution via git ls-remote)
|
|
135
154
|
- `internal/policy`: BuildKit source policy types and JSON output
|
|
136
155
|
- `internal/pin`: orchestration logic for `pin`
|
|
137
156
|
- `internal/integration`: end-to-end tests with mock registry/HTTP server and snapshots
|
|
Binary file
|