@intentius/chant-lexicon-docker 0.124.21 → 0.124.23

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.
Files changed (119) hide show
  1. package/dist/codegen/docs.d.ts.map +1 -1
  2. package/dist/codegen/generate.d.ts.map +1 -1
  3. package/dist/dockerfile-order.d.ts +13 -0
  4. package/dist/dockerfile-order.d.ts.map +1 -0
  5. package/dist/generated/index.d.ts +703 -6
  6. package/dist/generated/index.d.ts.map +1 -1
  7. package/dist/import/adapter.d.ts.map +1 -1
  8. package/dist/import/parser.d.ts +23 -0
  9. package/dist/import/parser.d.ts.map +1 -1
  10. package/dist/integrity.json +17 -8
  11. package/dist/lint/audit-catalog.d.ts.map +1 -1
  12. package/dist/lint/audit-lineage.d.ts.map +1 -1
  13. package/dist/lint/post-synth/add-url-checksum.d.ts +9 -0
  14. package/dist/lint/post-synth/add-url-checksum.d.ts.map +1 -0
  15. package/dist/lint/post-synth/apt-update-alone.d.ts +10 -0
  16. package/dist/lint/post-synth/apt-update-alone.d.ts.map +1 -0
  17. package/dist/lint/post-synth/cache-busting-copy.d.ts +11 -0
  18. package/dist/lint/post-synth/cache-busting-copy.d.ts.map +1 -0
  19. package/dist/lint/post-synth/copy-from-stage.d.ts +10 -0
  20. package/dist/lint/post-synth/copy-from-stage.d.ts.map +1 -0
  21. package/dist/lint/post-synth/docker-helpers.d.ts +35 -0
  22. package/dist/lint/post-synth/docker-helpers.d.ts.map +1 -1
  23. package/dist/lint/post-synth/index.d.ts.map +1 -1
  24. package/dist/lint/post-synth/no-root-user.d.ts +3 -2
  25. package/dist/lint/post-synth/no-root-user.d.ts.map +1 -1
  26. package/dist/lint/post-synth/relative-workdir.d.ts +10 -0
  27. package/dist/lint/post-synth/relative-workdir.d.ts.map +1 -0
  28. package/dist/lint/post-synth/repeated-cmd.d.ts +9 -0
  29. package/dist/lint/post-synth/repeated-cmd.d.ts.map +1 -0
  30. package/dist/lint/post-synth/root-after-user.d.ts +10 -0
  31. package/dist/lint/post-synth/root-after-user.d.ts.map +1 -0
  32. package/dist/lint/post-synth/unused-global-arg.d.ts +10 -0
  33. package/dist/lint/post-synth/unused-global-arg.d.ts.map +1 -0
  34. package/dist/lint/rules/index.d.ts +1 -0
  35. package/dist/lint/rules/index.d.ts.map +1 -1
  36. package/dist/lint/rules/per-kind-order.d.ts +15 -0
  37. package/dist/lint/rules/per-kind-order.d.ts.map +1 -0
  38. package/dist/manifest.json +1 -1
  39. package/dist/meta.json +444 -86
  40. package/dist/okf/index.md +10 -1
  41. package/dist/okf/rules/DKRD012.md +2 -2
  42. package/dist/okf/rules/DKRD013.md +11 -0
  43. package/dist/okf/rules/DKRD014.md +11 -0
  44. package/dist/okf/rules/DKRD015.md +11 -0
  45. package/dist/okf/rules/DKRD016.md +11 -0
  46. package/dist/okf/rules/DKRD017.md +11 -0
  47. package/dist/okf/rules/DKRD018.md +11 -0
  48. package/dist/okf/rules/DKRD019.md +11 -0
  49. package/dist/okf/rules/DKRD020.md +11 -0
  50. package/dist/okf/rules/DKRS002.md +15 -0
  51. package/dist/okf/types/DockerConfig.md +7 -5
  52. package/dist/okf/types/DockerSecret.md +8 -4
  53. package/dist/okf/types/Dockerfile.md +4 -1
  54. package/dist/okf/types/Network.md +10 -6
  55. package/dist/okf/types/Service.md +93 -15
  56. package/dist/okf/types/Volume.md +5 -5
  57. package/dist/plugin.d.ts.map +1 -1
  58. package/dist/rules/add-url-checksum.ts +38 -0
  59. package/dist/rules/apt-update-alone.ts +39 -0
  60. package/dist/rules/cache-busting-copy.ts +65 -0
  61. package/dist/rules/copy-from-stage.ts +54 -0
  62. package/dist/rules/docker-helpers.ts +80 -0
  63. package/dist/rules/no-root-user.ts +19 -17
  64. package/dist/rules/per-kind-order.ts +130 -0
  65. package/dist/rules/relative-workdir.ts +38 -0
  66. package/dist/rules/repeated-cmd.ts +35 -0
  67. package/dist/rules/root-after-user.ts +44 -0
  68. package/dist/rules/unused-global-arg.ts +38 -0
  69. package/dist/serializer.d.ts.map +1 -1
  70. package/dist/skills/chant-docker-patterns.md +93 -24
  71. package/dist/skills/chant-docker.md +43 -16
  72. package/dist/spec/parse-compose.d.ts +29 -2
  73. package/dist/spec/parse-compose.d.ts.map +1 -1
  74. package/dist/spec/parse-engine.d.ts +9 -0
  75. package/dist/spec/parse-engine.d.ts.map +1 -1
  76. package/dist/types/index.d.ts +344 -41
  77. package/package.json +3 -3
  78. package/src/codegen/__snapshots__/okf.test.ts.snap +278 -39
  79. package/src/codegen/docs.ts +14 -0
  80. package/src/codegen/generate.ts +128 -31
  81. package/src/codegen/okf.test.ts +1 -1
  82. package/src/dockerfile-order.ts +20 -0
  83. package/src/docs-examples.test.ts +141 -0
  84. package/src/generated/index.d.ts +344 -41
  85. package/src/generated/index.ts +396 -6
  86. package/src/generated/lexicon-docker.json +444 -86
  87. package/src/import/adapter.ts +8 -2
  88. package/src/import/generator.test.ts +4 -4
  89. package/src/import/generator.ts +53 -37
  90. package/src/import/parser.ts +82 -13
  91. package/src/import/roundtrip.test.ts +167 -2
  92. package/src/import/testdata/configs-secrets.yaml +15 -0
  93. package/src/lint/audit-catalog.ts +9 -1
  94. package/src/lint/audit-lineage.ts +14 -0
  95. package/src/lint/post-synth/add-url-checksum.ts +38 -0
  96. package/src/lint/post-synth/apt-update-alone.ts +39 -0
  97. package/src/lint/post-synth/cache-busting-copy.ts +65 -0
  98. package/src/lint/post-synth/copy-from-stage.ts +54 -0
  99. package/src/lint/post-synth/docker-helpers.ts +80 -0
  100. package/src/lint/post-synth/index.ts +16 -0
  101. package/src/lint/post-synth/no-root-user.ts +19 -17
  102. package/src/lint/post-synth/post-synth.test.ts +149 -0
  103. package/src/lint/post-synth/relative-workdir.ts +38 -0
  104. package/src/lint/post-synth/repeated-cmd.ts +35 -0
  105. package/src/lint/post-synth/root-after-user.ts +44 -0
  106. package/src/lint/post-synth/unused-global-arg.ts +38 -0
  107. package/src/lint/rules/index.ts +1 -0
  108. package/src/lint/rules/per-kind-order.ts +130 -0
  109. package/src/lint/rules/rules.test.ts +88 -0
  110. package/src/plugin.test.ts +4 -0
  111. package/src/plugin.ts +2 -1
  112. package/src/serializer.test.ts +112 -0
  113. package/src/serializer.ts +58 -11
  114. package/src/skills/chant-docker-patterns.md +93 -24
  115. package/src/skills/chant-docker.md +43 -16
  116. package/src/spec/parse-compose.ts +167 -95
  117. package/src/spec/parse-engine.ts +17 -5
  118. package/src/typecheck.e2e.test.ts +107 -0
  119. package/src/typed-props.test.ts +60 -0
@@ -39,15 +39,21 @@ export const nfsdata = new Volume({ driver: "local", driver_opts: { type: "nfs",
39
39
 
40
40
  ## Dockerfile — generates Dockerfile.{name}:
41
41
 
42
+ Each stage is `from` plus `steps`. A step is an object with one key naming one instruction. Steps are written exactly in the order listed.
43
+
42
44
  ```typescript
43
- // Single-stage:
44
- export const builder = new Dockerfile({
45
+ // Single stage. Manifests before source, so the install layer is cached; root setup before USER.
46
+ export const server = new Dockerfile({
45
47
  from: "node:20-alpine",
46
- workdir: "/app",
47
- copy: ["package*.json ./"],
48
- run: ["npm ci --only=production"],
49
- user: "node",
50
- cmd: `["node", "dist/index.js"]`,
48
+ steps: [
49
+ { workdir: "/app" },
50
+ { copy: "package.json package-lock.json ./" },
51
+ { run: "npm ci --omit=dev" },
52
+ { copy: "src/ ./src/" },
53
+ { user: "node" },
54
+ { expose: 3000 },
55
+ { cmd: ["node", "src/index.js"] }, // a list is written in JSON exec form
56
+ ],
51
57
  });
52
58
 
53
59
  // Multi-stage build:
@@ -56,21 +62,37 @@ export const app = new Dockerfile({
56
62
  {
57
63
  from: "node:20-alpine",
58
64
  as: "build",
59
- workdir: "/app",
60
- copy: ["package*.json ./"],
61
- run: ["npm ci", "npm run build"],
65
+ steps: [
66
+ { workdir: "/app" },
67
+ { copy: "package.json package-lock.json ./" },
68
+ { run: "npm ci" },
69
+ { copy: ". ." },
70
+ { run: "npm run build" },
71
+ { run: "npm prune --omit=dev" },
72
+ ],
62
73
  },
63
74
  {
64
75
  from: "node:20-alpine",
65
- workdir: "/app",
66
- copy: ["--from=build /app/dist ./dist", "--from=build /app/node_modules ./node_modules"],
67
- user: "node",
68
- cmd: `["node", "dist/index.js"]`,
76
+ steps: [
77
+ { workdir: "/app" },
78
+ { copy: "--from=build /app/node_modules ./node_modules" },
79
+ { copy: "--from=build /app/dist ./dist" },
80
+ { user: "node" },
81
+ { cmd: ["node", "dist/index.js"] },
82
+ ],
69
83
  },
70
84
  ],
71
85
  });
72
86
  ```
73
87
 
88
+ Step keys: `arg`, `env`, `workdir`, `user`, `run`, `copy`, `add`, `expose`, `volume`, `label`, `entrypoint`, `cmd`, `healthcheck`, `shell`, `stopsignal`, `onbuild`. `from` and `as` are stage fields, and `globalArgs: ["NAME=value"]` writes `ARG` lines before the first `FROM`. `run`, `cmd`, `entrypoint` and `shell` take a string or a list (exec form); `expose` takes a number too.
89
+
90
+ Rules:
91
+ - Use `steps`. The older per-kind fields (`run: [...]`, `copy: [...]`, `user`) are written in a fixed order (ARG, ENV, WORKDIR, USER, RUN, COPY, ADD, EXPOSE, VOLUME, LABEL, ENTRYPOINT, CMD, HEALTHCHECK), not the order written, so every RUN lands before every COPY. Lint rule DKRS002 flags this, and `chant lint --fix` rewrites them as steps.
92
+ - A stage can't have both `steps` and per-kind fields, and a step can't name two instructions. Both are build errors.
93
+ - Props are type-checked: `Dockerfile` takes `DockerfileProps` and the Compose constructors take `ServiceProps`, `VolumeProps`, `NetworkProps`, `DockerConfigProps` and `DockerSecretProps`. A misspelled key or a wrong value type is a TypeScript error, so run `tsc` (or read the editor's errors) before `chant build`.
94
+ - To share stages or steps between Dockerfiles in different modules, export a `const` stage (`DockerfileStage`) or step list (`DockerfileStep[]`) and import it. List the stage in `stages`, or spread the steps: `steps: [...nodeRuntime, { cmd: ["node", "dist/server.js"] }]`. This is chant's equivalent of an INCLUDE. Spreading a function call's result is a lint error (EVL004); put parameterized Dockerfiles in a `Composite`.
95
+
74
96
  ## Variable interpolation with env():
75
97
 
76
98
  ```typescript
@@ -112,7 +134,10 @@ export const api = new Service({
112
134
  },
113
135
  ports: ["8080:8080"],
114
136
  });
115
- export const builder = new Dockerfile({ from: "node:20-alpine", ... });
137
+ export const builder = new Dockerfile({
138
+ from: "node:20-alpine",
139
+ steps: [{ workdir: "/app" }, { copy: ". ." }, { run: "npm ci" }, { user: "node" }, { cmd: ["node", "index.js"] }],
140
+ });
116
141
  ```
117
142
 
118
143
  ## Output structure
@@ -126,4 +151,6 @@ export const builder = new Dockerfile({ from: "node:20-alpine", ... });
126
151
  - `DKRD001`: Post-synth: no `:latest` images in generated YAML
127
152
  - `DKRD002`: Post-synth: no unused named volumes
128
153
  - `DKRD003`: Post-synth: SSH port 22 not exposed externally
129
- - `DKRD010–012`: Dockerfile best practices (apt recommends, COPY vs ADD, USER)
154
+ - `DKRS002`: Dockerfile per-kind fields declared in an order the fixed order changes; use `steps`
155
+ - `DKRD010–012`: Dockerfile best practices (apt recommends, COPY vs ADD, final stage USER)
156
+ - `DKRD013–020`: order-aware Dockerfile checks: COPY . before a dependency install, root-only RUN after USER, repeated CMD/ENTRYPOINT, COPY --from an undefined stage, unused ARG before FROM, relative WORKDIR, ADD of a URL without --checksum, apt-get update in its own RUN
@@ -19,9 +19,36 @@ export interface ComposeProperty {
19
19
  required?: boolean;
20
20
  enum?: string[];
21
21
  }
22
+ /**
23
+ * The TypeScript type of a Compose string slot. Compose interpolates every
24
+ * value, so `env()` fits where a string does; an entity (a service, network,
25
+ * volume, config, secret or Dockerfile) is written as its name.
26
+ */
27
+ export declare const COMPOSE_STRING = "ComposeString";
28
+ interface JsonSchema {
29
+ $ref?: string;
30
+ type?: string | string[];
31
+ description?: string;
32
+ enum?: unknown[];
33
+ const?: unknown;
34
+ properties?: Record<string, JsonSchema>;
35
+ patternProperties?: Record<string, JsonSchema>;
36
+ additionalProperties?: boolean | JsonSchema;
37
+ required?: string[];
38
+ items?: JsonSchema;
39
+ oneOf?: JsonSchema[];
40
+ anyOf?: JsonSchema[];
41
+ allOf?: JsonSchema[];
42
+ }
22
43
  /**
23
44
  * Parse the Compose Spec JSON Schema buffer into ParsedResult entries.
24
- * Returns one entry per top-level Compose resource type.
45
+ * Returns one entry per top-level Compose resource type, with a property for
46
+ * every field the spec defines on it (#3934). Each property's `type` is a
47
+ * TypeScript type converted from the schema; string slots use
48
+ * {@link COMPOSE_STRING}.
25
49
  */
26
- export declare function parseComposeSpec(_data: Buffer): ComposeParseResult[];
50
+ export declare function parseComposeSpec(data: Buffer): ComposeParseResult[];
51
+ /** Convert one JSON Schema node to a TypeScript type. `seen` guards $ref cycles. */
52
+ export declare function toTsType(schema: JsonSchema | boolean | undefined, defs: Record<string, JsonSchema>, seen?: Set<string>): string;
53
+ export {};
27
54
  //# sourceMappingURL=parse-compose.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-compose.d.ts","sourceRoot":"","sources":["../../src/spec/parse-compose.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,EAAE,CA8FpE"}
1
+ {"version":3,"file":"parse-compose.d.ts","sourceRoot":"","sources":["../../src/spec/parse-compose.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,UAAU,UAAU;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/C,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;CACtB;AAUD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAenE;AAWD,oFAAoF;AACpF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,GAAG,MAAM,CAmD1I"}
@@ -14,6 +14,15 @@ export interface DockerfileInstruction {
14
14
  name: string;
15
15
  description?: string;
16
16
  multi?: boolean;
17
+ /**
18
+ * Only available as a step (`{ shell: ... }` in `steps`), not as a per-kind
19
+ * field. The per-kind fields keep the set and fixed order they always had.
20
+ */
21
+ stepOnly?: boolean;
22
+ /** As a step, the value may be a JSON exec-form array as well as a string. */
23
+ execForm?: boolean;
24
+ /** As a step, the value may be a number as well as a string. */
25
+ numeric?: boolean;
17
26
  }
18
27
  /**
19
28
  * Parse the Docker Engine API YAML buffer for Dockerfile instruction types.
@@ -1 +1 @@
1
- {"version":3,"file":"parse-engine.d.ts","sourceRoot":"","sources":["../../src/spec/parse-engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,qBAAqB,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,CAsBnE"}
1
+ {"version":3,"file":"parse-engine.d.ts","sourceRoot":"","sources":["../../src/spec/parse-engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,qBAAqB,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,CAyBnE"}
@@ -1,94 +1,397 @@
1
1
  // Code generated by chant generate. DO NOT EDIT.
2
2
  import type { Declarable } from "@intentius/chant/declarable";
3
3
 
4
+ /** An `env()` interpolation, as returned by the lexicon's `env`. */
5
+ interface EnvIntrinsic { toJSON(): string; toString(): string; }
6
+
7
+ /**
8
+ * A Compose string value: a string, an `env()` interpolation, or an entity
9
+ * (service, network, volume, config, secret or Dockerfile), which is written as its name.
10
+ */
11
+ export type ComposeString = string | EnvIntrinsic | Declarable;
12
+
13
+ /** A containerized service definition in Docker Compose */
4
14
  export interface ServiceProps {
5
- image?: string;
6
- build?: object;
7
- command?: string | string[];
8
- entrypoint?: string | string[];
9
- environment?: Record<string, string>;
10
- ports?: string[];
11
- volumes?: string[];
12
- networks?: string[];
13
- depends_on?: string[] | Record<string, { condition: "service_started" | "service_healthy" | "service_completed_successfully"; restart?: boolean; required?: boolean }>;
14
- restart?: string;
15
- labels?: Record<string, string>;
16
- healthcheck?: object;
17
- deploy?: object;
18
- secrets?: string[];
19
- configs?: Array<string | { source: string | Declarable; target?: string; uid?: string; gid?: string; mode?: number }>;
15
+ develop?: { watch?: Array<{ ignore?: ComposeString | Array<ComposeString>; include?: ComposeString | Array<ComposeString>; path: ComposeString; action: "rebuild" | "sync" | "restart" | "sync+restart" | "sync+exec"; target?: ComposeString; exec?: { command: null | ComposeString | Array<ComposeString>; user?: ComposeString; privileged?: boolean | ComposeString; working_dir?: ComposeString; environment?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>; [key: `x-${string}`]: unknown }; initial_sync?: boolean; [key: `x-${string}`]: unknown }>; [key: `x-${string}`]: unknown } | null;
16
+ deploy?: { mode?: ComposeString; endpoint_mode?: ComposeString; replicas?: number | ComposeString; labels?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>; rollback_config?: { parallelism?: number | ComposeString; delay?: ComposeString; failure_action?: ComposeString; monitor?: ComposeString; max_failure_ratio?: number | ComposeString; order?: "start-first" | "stop-first"; [key: `x-${string}`]: unknown }; update_config?: { parallelism?: number | ComposeString; delay?: ComposeString; failure_action?: ComposeString; monitor?: ComposeString; max_failure_ratio?: number | ComposeString; order?: "start-first" | "stop-first"; [key: `x-${string}`]: unknown }; resources?: { limits?: { cpus?: number | ComposeString; memory?: ComposeString; pids?: number | ComposeString; [key: `x-${string}`]: unknown }; reservations?: { cpus?: number | ComposeString; memory?: ComposeString; generic_resources?: Array<{ discrete_resource_spec?: { kind?: ComposeString; value?: number | ComposeString; [key: `x-${string}`]: unknown }; [key: `x-${string}`]: unknown }>; devices?: Array<{ capabilities: Array<ComposeString>; count?: ComposeString | number; device_ids?: Array<ComposeString>; driver?: ComposeString; options?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>; [key: `x-${string}`]: unknown }>; [key: `x-${string}`]: unknown }; [key: `x-${string}`]: unknown }; restart_policy?: { condition?: ComposeString; delay?: ComposeString; max_attempts?: number | ComposeString; window?: ComposeString; [key: `x-${string}`]: unknown }; placement?: { constraints?: Array<ComposeString>; preferences?: Array<{ spread?: ComposeString; [key: `x-${string}`]: unknown }>; max_replicas_per_node?: number | ComposeString; [key: `x-${string}`]: unknown }; [key: `x-${string}`]: unknown } | null;
17
+ annotations?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>;
18
+ attach?: boolean | ComposeString;
19
+ /** Configuration options for building the service's image. */
20
+ build?: ComposeString | { context?: ComposeString; dockerfile?: ComposeString; dockerfile_inline?: ComposeString; entitlements?: Array<ComposeString>; args?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>; ssh?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>; labels?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>; cache_from?: Array<ComposeString>; cache_to?: Array<ComposeString>; no_cache?: boolean | ComposeString; no_cache_filter?: ComposeString | Array<ComposeString>; additional_contexts?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>; network?: ComposeString; provenance?: ComposeString | boolean; sbom?: ComposeString | boolean; pull?: boolean | ComposeString; target?: ComposeString; shm_size?: number | ComposeString; extra_hosts?: Record<string, ComposeString | Array<ComposeString>> | Array<ComposeString>; isolation?: ComposeString; privileged?: boolean | ComposeString; secrets?: Array<ComposeString | { source?: ComposeString; target?: ComposeString; uid?: ComposeString; gid?: ComposeString; mode?: number | ComposeString; [key: `x-${string}`]: unknown }>; tags?: Array<ComposeString>; ulimits?: Record<string, number | ComposeString | { hard: number | ComposeString; soft: number | ComposeString; [key: `x-${string}`]: unknown }>; platforms?: Array<ComposeString>; [key: `x-${string}`]: unknown };
21
+ /** Block IO configuration for the service. */
22
+ blkio_config?: { device_read_bps?: Array<{ path?: ComposeString; rate?: number | ComposeString }>; device_read_iops?: Array<{ path?: ComposeString; rate?: number | ComposeString }>; device_write_bps?: Array<{ path?: ComposeString; rate?: number | ComposeString }>; device_write_iops?: Array<{ path?: ComposeString; rate?: number | ComposeString }>; weight?: number | ComposeString; weight_device?: Array<{ path?: ComposeString; weight?: number | ComposeString }> };
23
+ /** Add Linux capabilities. For example, 'CAP_SYS_ADMIN', 'SYS_ADMIN', or 'NET_ADMIN'. */
24
+ cap_add?: Array<ComposeString>;
25
+ /** Drop Linux capabilities. For example, 'CAP_SYS_ADMIN', 'SYS_ADMIN', or 'NET_ADMIN'. */
26
+ cap_drop?: Array<ComposeString>;
27
+ /** Specify the cgroup namespace to join. Use 'host' to use the host's cgroup namespace, or 'private' to use a private cgroup namespace. */
28
+ cgroup?: "host" | "private";
29
+ /** Specify an optional parent cgroup for the container. */
30
+ cgroup_parent?: ComposeString;
31
+ /** Override the default command declared by the container image, for example 'CMD' in Dockerfile. */
32
+ command?: null | ComposeString | Array<ComposeString>;
33
+ /** Grant access to Configs on a per-service basis. */
34
+ configs?: Array<ComposeString | { source?: ComposeString; target?: ComposeString; uid?: ComposeString; gid?: ComposeString; mode?: number | ComposeString; [key: `x-${string}`]: unknown }>;
35
+ /** Specify a custom container name, rather than a generated default name. */
36
+ container_name?: ComposeString;
37
+ /** Number of usable CPUs. */
38
+ cpu_count?: ComposeString | number;
39
+ /** Percentage of CPU resources to use. */
40
+ cpu_percent?: ComposeString | number;
41
+ /** CPU shares (relative weight) for the container. */
42
+ cpu_shares?: number | ComposeString;
43
+ /** Limit the CPU CFS (Completely Fair Scheduler) quota. */
44
+ cpu_quota?: number | ComposeString;
45
+ /** Limit the CPU CFS (Completely Fair Scheduler) period. */
46
+ cpu_period?: number | ComposeString;
47
+ /** Limit the CPU real-time period in microseconds or a duration. */
48
+ cpu_rt_period?: number | ComposeString;
49
+ /** Limit the CPU real-time runtime in microseconds or a duration. */
50
+ cpu_rt_runtime?: number | ComposeString;
51
+ /** Number of CPUs to use. A floating-point value is supported to request partial CPUs. */
52
+ cpus?: number | ComposeString;
53
+ /** CPUs in which to allow execution (0-3, 0,1). */
54
+ cpuset?: ComposeString;
55
+ /** Configure the credential spec for managed service account. */
56
+ credential_spec?: { config?: ComposeString; file?: ComposeString; registry?: ComposeString; [key: `x-${string}`]: unknown };
57
+ /** Express dependency between services. Service dependencies cause services to be started in dependency order. The dependent service will wait for the dependency to be ready before starting. */
58
+ depends_on?: Array<ComposeString> | Record<string, { restart?: boolean | ComposeString; required?: boolean; condition: "service_started" | "service_healthy" | "service_completed_successfully"; [key: `x-${string}`]: unknown }>;
59
+ /** Add rules to the cgroup allowed devices list. */
60
+ device_cgroup_rules?: Array<ComposeString>;
61
+ /** List of device mappings for the container. */
62
+ devices?: Array<ComposeString | { source: ComposeString; target?: ComposeString; permissions?: ComposeString; [key: `x-${string}`]: unknown }>;
63
+ /** Custom DNS servers to set for the service container. */
64
+ dns?: ComposeString | Array<ComposeString>;
65
+ /** Custom DNS options to be passed to the container's DNS resolver. */
66
+ dns_opt?: Array<ComposeString>;
67
+ /** Custom DNS search domains to set on the service container. */
68
+ dns_search?: ComposeString | Array<ComposeString>;
69
+ /** Custom domain name to use for the service container. */
70
+ domainname?: ComposeString;
71
+ /** Override the default entrypoint declared by the container image, for example 'ENTRYPOINT' in Dockerfile. */
72
+ entrypoint?: null | ComposeString | Array<ComposeString>;
73
+ /** Add environment variables from a file or multiple files. Can be a single file path or a list of file paths. */
74
+ env_file?: ComposeString | Array<ComposeString | { path: ComposeString; format?: ComposeString; required?: boolean | ComposeString }>;
75
+ /** Add metadata to containers using files containing Docker labels. */
76
+ label_file?: ComposeString | Array<ComposeString>;
77
+ /** Add environment variables. You can use either an array or a list of KEY=VAL pairs. */
78
+ environment?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>;
79
+ /** Expose ports without publishing them to the host machine - they'll only be accessible to linked services. */
80
+ expose?: Array<ComposeString | number>;
81
+ /** Extend another service, in the current file or another file. */
82
+ extends?: ComposeString | { service: ComposeString; file?: ComposeString };
83
+ /** Specify a service which will not be manage by Compose directly, and delegate its management to an external provider. */
84
+ provider?: { type: ComposeString; options?: Record<string, ComposeString | number | boolean | Array<ComposeString | number | boolean>>; [key: `x-${string}`]: unknown };
85
+ /** Link to services started outside this Compose application. Specify services as <service_name>:<alias>. */
86
+ external_links?: Array<ComposeString>;
87
+ /** Add hostname mappings to the container network interface configuration. */
88
+ extra_hosts?: Record<string, ComposeString | Array<ComposeString>> | Array<ComposeString>;
89
+ /** Define GPU devices to use. Can be set to 'all' to use all GPUs, or a list of specific GPU devices. */
90
+ gpus?: "all" | Array<{ capabilities?: Array<ComposeString>; count?: ComposeString | number; device_ids?: Array<ComposeString>; driver?: ComposeString; options?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString> }>;
91
+ /** Add additional groups which user inside the container should be member of. */
92
+ group_add?: Array<ComposeString | number>;
93
+ /** Configure a health check for the container to monitor its health status. */
94
+ healthcheck?: { disable?: boolean | ComposeString; interval?: ComposeString; retries?: number | ComposeString; test?: ComposeString | Array<ComposeString>; timeout?: ComposeString; start_period?: ComposeString; start_interval?: ComposeString; [key: `x-${string}`]: unknown };
95
+ /** Define a custom hostname for the service container. */
96
+ hostname?: ComposeString;
97
+ /** Specify the image to start the container from. Can be a repository/tag, a digest, or a local image ID. */
98
+ image?: ComposeString;
99
+ /** Run as an init process inside the container that forwards signals and reaps processes. */
100
+ init?: boolean | ComposeString;
101
+ /** IPC sharing mode for the service container. Use 'host' to share the host's IPC namespace, 'service:[service_name]' to share with another service, or 'shareable' to allow other services to share this service's IPC namespace. */
102
+ ipc?: ComposeString;
103
+ /** Container isolation technology to use. Supported values are platform-specific. */
104
+ isolation?: ComposeString;
105
+ /** Add metadata to containers using Docker labels. You can use either an array or a list. */
106
+ labels?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>;
107
+ /** Link to containers in another service. Either specify both the service name and a link alias (SERVICE:ALIAS), or just the service name. */
108
+ links?: Array<ComposeString>;
109
+ /** Logging configuration for the service. */
110
+ logging?: { driver?: ComposeString; options?: Record<string, ComposeString | number | null>; [key: `x-${string}`]: unknown };
111
+ /** Container MAC address to set. */
112
+ mac_address?: ComposeString;
113
+ /** Memory limit for the container. A string value can use suffix like '2g' for 2 gigabytes. */
114
+ mem_limit?: number | ComposeString;
115
+ /** Memory reservation for the container. */
116
+ mem_reservation?: ComposeString | number;
117
+ /** Container memory swappiness as percentage (0 to 100). */
118
+ mem_swappiness?: number | ComposeString;
119
+ /** Amount of memory the container is allowed to swap to disk. Set to -1 to enable unlimited swap. */
120
+ memswap_limit?: number | ComposeString;
121
+ /** Network mode. Values can be 'bridge', 'host', 'none', 'service:[service name]', or 'container:[container name]'. */
122
+ network_mode?: ComposeString;
123
+ /** AI Models to use, referencing entries under the top-level models key. */
124
+ models?: Array<ComposeString> | Record<string, { endpoint_var?: ComposeString; model_var?: ComposeString; [key: `x-${string}`]: unknown } | null>;
125
+ /** Networks to join, referencing entries under the top-level networks key. Can be a list of network names or a mapping of network name to network configuration. */
126
+ networks?: Array<ComposeString> | Record<string, { aliases?: Array<ComposeString>; interface_name?: ComposeString; ipv4_address?: ComposeString; ipv6_address?: ComposeString; link_local_ips?: Array<ComposeString>; mac_address?: ComposeString; driver_opts?: Record<string, ComposeString | number>; priority?: number; gw_priority?: number; [key: `x-${string}`]: unknown } | null>;
127
+ /** Disable OOM Killer for the container. */
128
+ oom_kill_disable?: boolean | ComposeString;
129
+ /** Tune host's OOM preferences for the container (accepts -1000 to 1000). */
130
+ oom_score_adj?: ComposeString | number;
131
+ /** PID mode for container. */
132
+ pid?: ComposeString | null;
133
+ /** Tune a container's PIDs limit. Set to -1 for unlimited PIDs. */
134
+ pids_limit?: number | ComposeString;
135
+ /** Target platform to run on, e.g., 'linux/amd64', 'linux/arm64', or 'windows/amd64'. */
136
+ platform?: ComposeString;
137
+ /** Expose container ports. Short format ([HOST:]CONTAINER[/PROTOCOL]). */
138
+ ports?: Array<number | ComposeString | { name?: ComposeString; mode?: ComposeString; host_ip?: ComposeString; target?: number | ComposeString; published?: ComposeString | number; protocol?: ComposeString; app_protocol?: ComposeString; [key: `x-${string}`]: unknown }>;
139
+ /** Init containers to run to completion before the service container is started. Each step runs in its own ephemeral container, in declared order; a non-zero exit fails the bring-up of the service and its dependents. */
140
+ pre_start?: Array<{ command?: null | ComposeString | Array<ComposeString>; image?: ComposeString; user?: ComposeString; privileged?: boolean | ComposeString; working_dir?: ComposeString; environment?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>; per_replica?: boolean | ComposeString; [key: `x-${string}`]: unknown }>;
141
+ /** Commands to run after the container starts. If any command fails, the container stops. */
142
+ post_start?: Array<{ command: null | ComposeString | Array<ComposeString>; user?: ComposeString; privileged?: boolean | ComposeString; working_dir?: ComposeString; environment?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>; [key: `x-${string}`]: unknown }>;
143
+ /** Commands to run before the container stops. If any command fails, the container stop is aborted. */
144
+ pre_stop?: Array<{ command: null | ComposeString | Array<ComposeString>; user?: ComposeString; privileged?: boolean | ComposeString; working_dir?: ComposeString; environment?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>; [key: `x-${string}`]: unknown }>;
145
+ /** Give extended privileges to the service container. */
146
+ privileged?: boolean | ComposeString;
147
+ /** List of profiles for this service. When profiles are specified, services are only started when the profile is activated. */
148
+ profiles?: Array<ComposeString>;
149
+ /** Policy for pulling images. Options include: 'always', 'never', 'if_not_present', 'missing', 'build', or time-based refresh policies. */
150
+ pull_policy?: ComposeString;
151
+ /** Time after which to refresh the image. Used with pull_policy=refresh. */
152
+ pull_refresh_after?: ComposeString;
153
+ /** Mount the container's filesystem as read only. */
154
+ read_only?: boolean | ComposeString;
155
+ /** Restart policy for the service container. Options include: 'no', 'always', 'on-failure', and 'unless-stopped'. */
156
+ restart?: ComposeString;
157
+ /** Runtime to use for this container, e.g., 'runc'. */
158
+ runtime?: ComposeString;
159
+ /** Number of containers to deploy for this service. */
160
+ scale?: number | ComposeString;
161
+ /** Override the default labeling scheme for each container. */
162
+ security_opt?: Array<ComposeString>;
163
+ /** Size of /dev/shm. A string value can use suffix like '2g' for 2 gigabytes. */
164
+ shm_size?: number | ComposeString;
165
+ /** Grant access to Secrets on a per-service basis. */
166
+ secrets?: Array<ComposeString | { source?: ComposeString; target?: ComposeString; uid?: ComposeString; gid?: ComposeString; mode?: number | ComposeString; [key: `x-${string}`]: unknown }>;
167
+ /** Kernel parameters to set in the container. You can use either an array or a list. */
168
+ sysctls?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>;
169
+ /** Keep STDIN open even if not attached. */
170
+ stdin_open?: boolean | ComposeString;
171
+ /** Time to wait for the container to stop gracefully before sending SIGKILL (e.g., '1s', '1m30s'). */
172
+ stop_grace_period?: ComposeString;
173
+ /** Signal to stop the container (e.g., 'SIGTERM', 'SIGINT'). */
174
+ stop_signal?: ComposeString;
175
+ /** Storage driver options for the container. */
176
+ storage_opt?: Record<string, unknown>;
177
+ /** Mount a temporary filesystem (tmpfs) into the container. Can be a single value or a list. */
178
+ tmpfs?: ComposeString | Array<ComposeString>;
179
+ /** Allocate a pseudo-TTY to service container. */
180
+ tty?: boolean | ComposeString;
181
+ /** Override the default ulimits for a container. */
182
+ ulimits?: Record<string, number | ComposeString | { hard: number | ComposeString; soft: number | ComposeString; [key: `x-${string}`]: unknown }>;
183
+ /** Bind mount Docker API socket and required auth. */
184
+ use_api_socket?: boolean;
185
+ /** Username or UID to run the container process as. */
186
+ user?: ComposeString;
187
+ /** UTS namespace to use. 'host' shares the host's UTS namespace. */
188
+ uts?: ComposeString;
189
+ /** User namespace to use. 'host' shares the host's user namespace. */
190
+ userns_mode?: ComposeString;
191
+ /** Mount host paths or named volumes accessible to the container. Short syntax (VOLUME:CONTAINER_PATH[:MODE]) */
192
+ volumes?: Array<ComposeString | { type: "bind" | "volume" | "tmpfs" | "cluster" | "npipe" | "image"; source?: ComposeString; target?: ComposeString; read_only?: boolean | ComposeString; consistency?: ComposeString; bind?: { propagation?: ComposeString; create_host_path?: boolean | ComposeString; recursive?: "enabled" | "disabled" | "writable" | "readonly"; selinux?: "z" | "Z"; [key: `x-${string}`]: unknown }; volume?: { labels?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>; nocopy?: boolean | ComposeString; subpath?: ComposeString; [key: `x-${string}`]: unknown }; tmpfs?: { size?: number | ComposeString; mode?: number | ComposeString; [key: `x-${string}`]: unknown }; image?: { subpath?: ComposeString; [key: `x-${string}`]: unknown }; [key: `x-${string}`]: unknown }>;
193
+ /** Mount volumes from another service or container. Optionally specify read-only access (ro) or read-write (rw). */
194
+ volumes_from?: Array<ComposeString>;
195
+ /** The working directory in which the entrypoint or command will be run */
196
+ working_dir?: ComposeString;
20
197
  }
21
- export declare const Service: new (props?: ServiceProps) => Declarable;
22
198
 
199
+ /** A named volume definition in Docker Compose */
23
200
  export interface VolumeProps {
24
- driver?: string;
25
- driver_opts?: Record<string, string>;
26
- external?: boolean;
27
- labels?: Record<string, string>;
28
- name?: string;
201
+ /** Custom name for this volume. */
202
+ name?: ComposeString;
203
+ /** Specify which volume driver should be used for this volume. */
204
+ driver?: ComposeString;
205
+ /** Specify driver-specific options. */
206
+ driver_opts?: Record<string, ComposeString | number>;
207
+ /** Specifies that this volume already exists and was created outside of Compose. */
208
+ external?: boolean | ComposeString | { name?: ComposeString; [key: `x-${string}`]: unknown };
209
+ /** Add metadata to the volume using labels. */
210
+ labels?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>;
29
211
  }
30
- export declare const Volume: new (props?: VolumeProps) => Declarable;
31
212
 
213
+ /** A network definition in Docker Compose */
32
214
  export interface NetworkProps {
33
- driver?: string;
34
- driver_opts?: Record<string, string>;
35
- external?: boolean;
36
- labels?: Record<string, string>;
37
- internal?: boolean;
38
- ipam?: object;
215
+ /** Custom name for this network. */
216
+ name?: ComposeString;
217
+ /** Specify which driver should be used for this network. Default is 'bridge'. */
218
+ driver?: ComposeString;
219
+ /** Specify driver-specific options defined as key/value pairs. */
220
+ driver_opts?: Record<string, ComposeString | number>;
221
+ /** Custom IP Address Management configuration for this network. */
222
+ ipam?: { driver?: ComposeString; config?: Array<{ subnet?: ComposeString; ip_range?: ComposeString; gateway?: ComposeString; aux_addresses?: Record<string, ComposeString>; [key: `x-${string}`]: unknown }>; options?: Record<string, ComposeString>; [key: `x-${string}`]: unknown };
223
+ /** Specifies that this network already exists and was created outside of Compose. */
224
+ external?: boolean | ComposeString | { name?: ComposeString; [key: `x-${string}`]: unknown };
225
+ /** Create an externally isolated network. */
226
+ internal?: boolean | ComposeString;
227
+ /** Enable IPv4 networking. */
228
+ enable_ipv4?: boolean | ComposeString;
229
+ /** Enable IPv6 networking. */
230
+ enable_ipv6?: boolean | ComposeString;
231
+ /** If true, standalone containers can attach to this network. */
232
+ attachable?: boolean | ComposeString;
233
+ /** Add metadata to the network using labels. */
234
+ labels?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>;
39
235
  }
40
- export declare const Network: new (props?: NetworkProps) => Declarable;
41
236
 
237
+ /** A config definition in Docker Compose */
42
238
  export interface DockerConfigProps {
43
- file?: string;
44
- content?: string;
45
- external?: boolean;
46
- labels?: Record<string, string>;
47
- name?: string;
239
+ /** Custom name for this config. */
240
+ name?: ComposeString;
241
+ /** Inline content of the config. */
242
+ content?: ComposeString;
243
+ /** Name of an environment variable from which to get the config value. */
244
+ environment?: ComposeString;
245
+ /** Path to a file containing the config value. */
246
+ file?: ComposeString;
247
+ /** Specifies that this config already exists and was created outside of Compose. */
248
+ external?: boolean | ComposeString | { name?: ComposeString };
249
+ /** Add metadata to the config using labels. */
250
+ labels?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>;
251
+ /** Driver to use for templating the config's value. */
252
+ template_driver?: ComposeString;
48
253
  }
49
- export declare const DockerConfig: new (props?: DockerConfigProps) => Declarable;
50
254
 
255
+ /** A secret definition in Docker Compose */
51
256
  export interface DockerSecretProps {
52
- file?: string;
53
- external?: boolean;
54
- labels?: Record<string, string>;
55
- name?: string;
257
+ /** Custom name for this secret. */
258
+ name?: ComposeString;
259
+ /** Name of an environment variable from which to get the secret value. */
260
+ environment?: ComposeString;
261
+ /** Path to a file containing the secret value. */
262
+ file?: ComposeString;
263
+ /** Specifies that this secret already exists and was created outside of Compose. */
264
+ external?: boolean | ComposeString | { name?: ComposeString };
265
+ /** Add metadata to the secret using labels. */
266
+ labels?: Record<string, ComposeString | number | boolean | null> | Array<ComposeString>;
267
+ /** Specify which secret driver should be used for this secret. */
268
+ driver?: ComposeString;
269
+ /** Specify driver-specific options. */
270
+ driver_opts?: Record<string, ComposeString | number>;
271
+ /** Driver to use for templating the secret's value. */
272
+ template_driver?: ComposeString;
56
273
  }
57
- export declare const DockerSecret: new (props?: DockerSecretProps) => Declarable;
58
274
 
275
+ export declare const Service: new (props?: ServiceProps, attributes?: Record<string, unknown>) => Declarable;
276
+ export declare const Volume: new (props?: VolumeProps, attributes?: Record<string, unknown>) => Declarable;
277
+ export declare const Network: new (props?: NetworkProps, attributes?: Record<string, unknown>) => Declarable;
278
+ export declare const DockerConfig: new (props?: DockerConfigProps, attributes?: Record<string, unknown>) => Declarable;
279
+ export declare const DockerSecret: new (props?: DockerSecretProps, attributes?: Record<string, unknown>) => Declarable;
280
+
281
+ /** The Dockerfile instructions a step can name. FROM is the stage's own `from` field. */
282
+ export type DockerfileInstructionName = "arg" | "env" | "run" | "copy" | "add" | "workdir" | "user" | "expose" | "volume" | "label" | "entrypoint" | "cmd" | "healthcheck" | "shell" | "stopsignal" | "onbuild";
283
+ type DockerfileStepOf<K extends DockerfileInstructionName, V> = { [P in K]: V } & { [P in Exclude<DockerfileInstructionName, K>]?: never };
284
+ /**
285
+ * One Dockerfile instruction, named by its single key: `{ run: "npm ci" }` is `RUN npm ci`.
286
+ * A string[] value (run, cmd, entrypoint, shell) is written in JSON exec form.
287
+ */
288
+ export type DockerfileStep =
289
+ /** ARG: Build-time argument */
290
+ | DockerfileStepOf<"arg", string>
291
+ /** ENV: Environment variable */
292
+ | DockerfileStepOf<"env", string>
293
+ /** RUN: Run a command during build */
294
+ | DockerfileStepOf<"run", string | string[]>
295
+ /** COPY: Copy files from build context */
296
+ | DockerfileStepOf<"copy", string>
297
+ /** ADD: Add files (supports URLs and archives) */
298
+ | DockerfileStepOf<"add", string>
299
+ /** WORKDIR: Set working directory */
300
+ | DockerfileStepOf<"workdir", string>
301
+ /** USER: Set user for subsequent instructions */
302
+ | DockerfileStepOf<"user", string>
303
+ /** EXPOSE: Document exposed ports */
304
+ | DockerfileStepOf<"expose", string | number>
305
+ /** VOLUME: Create mount points */
306
+ | DockerfileStepOf<"volume", string>
307
+ /** LABEL: Add metadata labels */
308
+ | DockerfileStepOf<"label", string>
309
+ /** ENTRYPOINT: Set the entrypoint executable */
310
+ | DockerfileStepOf<"entrypoint", string | string[]>
311
+ /** CMD: Default command arguments */
312
+ | DockerfileStepOf<"cmd", string | string[]>
313
+ /** HEALTHCHECK: Health check instruction */
314
+ | DockerfileStepOf<"healthcheck", string>
315
+ /** SHELL: Set the shell for shell-form commands (JSON array form) */
316
+ | DockerfileStepOf<"shell", string | string[]>
317
+ /** STOPSIGNAL: Signal sent to stop the container */
318
+ | DockerfileStepOf<"stopsignal", string>
319
+ /** ONBUILD: Instruction to run when the image is used as a base */
320
+ | DockerfileStepOf<"onbuild", string>;
321
+ /**
322
+ * One build stage: FROM, then its instructions.
323
+ * Without `steps`, the per-kind fields are written in a fixed order: ARG, ENV, WORKDIR, USER, RUN, COPY, ADD, EXPOSE, VOLUME, LABEL, ENTRYPOINT, CMD, HEALTHCHECK.
324
+ */
59
325
  export interface DockerfileStage {
60
326
  from: string;
61
327
  as?: string;
328
+ /** Instructions after FROM, written exactly in this order. Can't be combined with the per-kind fields. */
329
+ steps?: DockerfileStep[];
330
+ /** ARG as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
62
331
  arg?: string[];
332
+ /** ENV as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
63
333
  env?: string[];
334
+ /** RUN as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
64
335
  run?: string[];
336
+ /** COPY as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
65
337
  copy?: string[];
338
+ /** ADD as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
66
339
  add?: string[];
340
+ /** WORKDIR as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
67
341
  workdir?: string;
342
+ /** USER as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
68
343
  user?: string;
344
+ /** EXPOSE as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
69
345
  expose?: string[];
346
+ /** VOLUME as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
70
347
  volume?: string[];
348
+ /** LABEL as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
71
349
  label?: string[];
350
+ /** ENTRYPOINT as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
72
351
  entrypoint?: string;
352
+ /** CMD as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
73
353
  cmd?: string;
354
+ /** HEALTHCHECK as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
74
355
  healthcheck?: string;
75
356
  }
357
+ /**
358
+ * A Dockerfile: `stages` for a multi-stage build, or `from` and the stage fields for one stage.
359
+ * Without `steps`, the per-kind fields are written in a fixed order: ARG, ENV, WORKDIR, USER, RUN, COPY, ADD, EXPOSE, VOLUME, LABEL, ENTRYPOINT, CMD, HEALTHCHECK.
360
+ */
76
361
  export interface DockerfileProps {
77
362
  name?: string;
363
+ /** ARG instructions written before the first FROM, e.g. `["NODE_VERSION=20"]`. */
364
+ globalArgs?: string[];
78
365
  from?: string;
366
+ as?: string;
79
367
  stages?: DockerfileStage[];
368
+ /** Instructions after FROM, written exactly in this order. Can't be combined with the per-kind fields. */
369
+ steps?: DockerfileStep[];
370
+ /** ARG as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
80
371
  arg?: string[];
372
+ /** ENV as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
81
373
  env?: string[];
374
+ /** RUN as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
82
375
  run?: string[];
376
+ /** COPY as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
83
377
  copy?: string[];
378
+ /** ADD as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
84
379
  add?: string[];
380
+ /** WORKDIR as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
85
381
  workdir?: string;
382
+ /** USER as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
86
383
  user?: string;
384
+ /** EXPOSE as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
87
385
  expose?: string[];
386
+ /** VOLUME as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
88
387
  volume?: string[];
388
+ /** LABEL as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
89
389
  label?: string[];
390
+ /** ENTRYPOINT as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
90
391
  entrypoint?: string;
392
+ /** CMD as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
91
393
  cmd?: string;
394
+ /** HEALTHCHECK as a per-kind field, written in the fixed order. Use `steps` to choose the order. */
92
395
  healthcheck?: string;
93
396
  }
94
- export declare const Dockerfile: new (props?: DockerfileProps) => Declarable;
397
+ export declare const Dockerfile: new (props?: DockerfileProps, attributes?: Record<string, unknown>) => Declarable;