Skip to content

Commit 12c2232

Browse files
committed
Simpler approach building spec.md
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 4bb95dc commit 12c2232

17 files changed

+43
-34
lines changed

01-status.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ to support those running modes:
2222
* default: warn user about unsupported attributes, but ignore them
2323
* strict: warn user about unsupported attributes and reject the compose file
2424
* loose: ignore unsupported attributes AND unknown attributes (that were not defined by the spec by the time implementation was created)
25+

02-model.md

+1
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,4 @@ Secrets and configs are read-only. The volume configuration allows you to select
105105
to tweak volume management according to the actual infrastructure. Configs and Secrets rely on platform services,
106106
and are declared `external` as they are not managed as part of the application lifecycle: the Compose implementation
107107
will use a platform-specific lookup mechanism to retrieve runtime values.
108+

03-compose-file.md

+1
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ services:
7676
- If Compose implementation is executed with `zot` as explicit service to run and profile `test` enabled,
7777
profile `debug` is automatically enabled and service `bar` is pulled in as a dependency starting both
7878
services `zot` and `bar`.
79+

04-version-and-name.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ services:
2626
- COMPOSE_PROJECT_NAME
2727
command: echo "I'm running ${COMPOSE_PROJECT_NAME}"
2828
```
29+

05-services.md

+1
Original file line numberDiff line numberDiff line change
@@ -1695,3 +1695,4 @@ volumes_from:
16951695
### working_dir
16961696

16971697
`working_dir` overrides the container's working directory from that specified by image (i.e. Dockerfile `WORKDIR`).
1698+

06-networks.md

+1
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,4 @@ networks:
205205
external: true
206206
name: "${NETWORK_ID}"
207207
```
208+

07-volumes.md

+1
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,4 @@ volumes:
127127
name: ${DATABASE_VOLUME}
128128
```
129129

130+

08-configs.md

+1
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ If `external` is set to `true` and secret configuration has other but `name` att
5656
not managed by compose lifecycle, Compose Implementations SHOULD reject a Compose file as invalid.
5757

5858
Compose file need to explicitly grant access to the configs to relevant services in the application.
59+

09-secrets.md

+1
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ not managed by compose lifecycle, Compose Implementations SHOULD reject a Compos
5656

5757
Compose file need to explicitly grant access to the secrets to relevant services in the application.
5858

59+

10-fragments.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ volumes:
3232
<<: *default-volume
3333
name: "metrics"
3434
```
35+

11-extension.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ Value can can combine multiple values and using without separator.
8383
40s
8484
1m30s
8585
1h5m30s20ms
86-
```
86+
```

12-interpolation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ If the Compose implementation can't resolve a substituted variable and no defaul
4242
the user and substitute the variable with an empty string.
4343
4444
As any values in a Compose file can be interpolated with variable substitution, including compact string notation
45-
for complex elements, interpolation MUST be applied _before_ merge on a per-file-basis.
45+
for complex elements, interpolation MUST be applied _before_ merge on a per-file-basis.

Dockerfile

+17-7
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,25 @@ RUN jsonschema2md -d /schema/ -e json
88
FROM scratch as docs
99
COPY --from=generator /out /
1010

11-
FROM --platform=${BUILDPLATFORM} node:19.6.1-alpine as spec-build
12-
RUN apk add --no-cache rsync git
13-
RUN npm install -g markdown-include
11+
FROM --platform=${BUILDPLATFORM} alpine as spec-build
1412
WORKDIR /src
15-
RUN --mount=target=/context \
16-
--mount=target=.,type=tmpfs <<EOT
13+
COPY *.md /src
14+
RUN <<EOT
1715
set -e
18-
rsync -a /context/. .
19-
markdown-include markdown-include.json
16+
cat head.md > spec.md
17+
cat 01-status.md >> spec.md
18+
cat 02-model.md >> spec.m >> spec.md
19+
cat 03-compose-file.md >> spec.md
20+
cat 04-version-and-name.md >> spec.md
21+
cat 05-services.md >> spec.md
22+
cat 06-networks.md >> spec.md
23+
cat 07-volumes.md >> spec.md
24+
cat 08-configs.md >> spec.md
25+
cat 09-secrets.md >> spec.md
26+
cat 10-fragments.md >> spec.md
27+
cat 11-extension.md >> spec.md
28+
cat 12-interpolation.md >> spec.md
29+
2030
mkdir /out
2131
cp spec.md /out
2232
EOT

build.md

+1
Original file line numberDiff line numberDiff line change
@@ -493,3 +493,4 @@ services:
493493

494494
* [docker-compose](https://docs.docker.com/compose)
495495
* [buildX bake](https://docs.docker.com/buildx/working-with-buildx/)
496+

head.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!---
2+
This file is generated, changes will be overwritten or CI specification check will fail
3+
All changes should be done in the markdown files located in the spec directory
4+
-->
5+
# The Compose Specification
6+
{:.no_toc}
7+
8+
* ToC
9+
{:toc}
10+

spec.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2553,15 +2553,15 @@ Interpolation can also be nested:
25532553
Other extended shell-style features, such as `${VARIABLE/foo/bar}`, are not
25542554
supported by the Compose specification.
25552555
2556-
You can use a `$` (double-dollar sign) when your configuration needs a literal
2557-
dollar sign. This also prevents Compose from interpolating a value, so a `$`
2556+
You can use a `$$` (double-dollar sign) when your configuration needs a literal
2557+
dollar sign. This also prevents Compose from interpolating a value, so a `$$`
25582558
allows you to refer to environment variables that you don't want processed by
25592559
Compose.
25602560
25612561
```yml
25622562
web:
25632563
build: .
2564-
command: "$VAR_NOT_INTERPOLATED_BY_COMPOSE"
2564+
command: "$$VAR_NOT_INTERPOLATED_BY_COMPOSE"
25652565
```
25662566

25672567
If the Compose implementation can't resolve a substituted variable and no default value is defined, it MUST warn

spec.template.md

-22
This file was deleted.

0 commit comments

Comments
 (0)