@@ -51,7 +51,7 @@ When used to build service images from source, the Compose file creates three Do
5151
5252* ` example/webapp`: A Docker image is built using `webapp` sub-directory, within the Compose file's parent folder, as the Docker build context. Lack of a `Dockerfile` within this folder throws an error.
5353* `example/database`: A Docker image is built using `backend` sub-directory within the Compose file parent folder. `backend.Dockerfile` file is used to define build steps, this file is searched relative to the context path, which means `..` resolves to the Compose file's parent folder, so `backend.Dockerfile` is a sibling file.
54- * A Docker image is built using the `custom` directory with the user's HOME as the Docker context. Compose displays a warning about the non-portable path used to build image.
54+ * A Docker image is built using the `custom` directory with the user's `$ HOME` as the Docker context. Compose displays a warning about the non-portable path used to build image.
5555
5656On push, both `example/webapp` and `example/database` Docker images are pushed to the default registry. The `custom` service image is skipped as no `image` attribute is set and Compose displays a warning about this missing attribute.
5757
@@ -81,7 +81,7 @@ The second part represents a subdirectory inside the repository that is used as
8181
8282Alternatively `build` can be an object with fields defined as follows :
8383
84- # ## additional_contexts
84+ # ## ` additional_contexts`
8585
8686{{< introduced compose 2.17.0 "/manuals/compose/releases/release-notes.md#2170" >}}
8787
@@ -118,9 +118,9 @@ the unused contexts.
118118Illustrative examples of how this is used in Buildx can be found
119119[here](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#-additional-build-contexts---build-context).
120120
121- # ## args
121+ # ## ` args`
122122
123- ` args` define build arguments, i.e. Dockerfile `ARG` values.
123+ ` args` define build arguments, that is Dockerfile `ARG` values.
124124
125125Using the following Dockerfile as an example :
126126
@@ -146,16 +146,16 @@ build:
146146` ` `
147147
148148Values can be omitted when specifying a build argument, in which case its value at build time must be obtained by user interaction,
149- otherwise the build arg won't be set when building the Docker image.
149+ otherwise the build argument won't be set when building the Docker image.
150150
151151` ` ` yml
152152args:
153153 - GIT_COMMIT
154154` ` `
155155
156- # ## context
156+ # ## ` context`
157157
158- ` context` defines either a path to a directory containing a Dockerfile, or a URL to a git repository.
158+ ` context` defines either a path to a directory containing a Dockerfile, or a URL to a Git repository.
159159
160160When the value supplied is a relative path, it is interpreted as relative to the project directory.
161161Compose warns you about the absolute path used to define the build context as those prevent the Compose file
@@ -174,7 +174,7 @@ services:
174174
175175If not set explicitly, `context` defaults to project directory (`.`).
176176
177- # ## cache_from
177+ # ## ` cache_from`
178178
179179` cache_from` defines a list of sources the image builder should use for cache resolution.
180180
@@ -196,7 +196,7 @@ build:
196196
197197Unsupported caches are ignored and don't prevent you from building images.
198198
199- # ## cache_to
199+ # ## ` cache_to`
200200
201201` cache_to` defines a list of export locations to be used to share build cache with future builds.
202202
@@ -212,7 +212,7 @@ Cache target is defined using the same `type=TYPE[,KEY=VALUE]` syntax defined by
212212
213213Unsupported caches are ignored and don't prevent you from building images.
214214
215- # ## dockerfile
215+ # ## ` dockerfile`
216216
217217` dockerfile` sets an alternate Dockerfile. A relative path is resolved from the build context.
218218Compose warns you about the absolute path used to define the Dockerfile as it prevents Compose files
@@ -227,7 +227,7 @@ build:
227227 dockerfile: webapp.Dockerfile
228228` ` `
229229
230- # ## dockerfile_inline
230+ # ## ` dockerfile_inline`
231231
232232{{< introduced compose 2.17.0 "/manuals/compose/releases/release-notes.md#2170" >}}
233233
@@ -244,7 +244,7 @@ build:
244244 RUN some command
245245` ` `
246246
247- # ## entitlements
247+ # ## ` entitlements`
248248
249249{{< introduced compose 2.27.1 "/manuals/compose/releases/release-notes.md#2271" >}}
250250
@@ -256,9 +256,9 @@ build:
256256 - security.insecure
257257 ` ` `
258258
259- # ## extra_hosts
259+ # ## ` extra_hosts`
260260
261- ` extra_hosts` adds hostname mappings at build-time. Use the same syntax as [extra_hosts](services.md#extra_hosts).
261+ ` extra_hosts` adds hostname mappings at build-time. Use the same syntax as [` extra_hosts` ](services.md#extra_hosts).
262262
263263` ` ` yml
264264extra_hosts:
@@ -290,12 +290,12 @@ configuration, which means for Linux `/etc/hosts` will get extra lines:
290290::1 myhostv6
291291` ` `
292292
293- # ## isolation
293+ # ## ` isolation`
294294
295295` isolation` specifies a build’s container isolation technology. Like [isolation](services.md#isolation), supported values
296296are platform specific.
297297
298- # ## labels
298+ # ## ` labels`
299299
300300` labels` add metadata to the resulting image. `labels` can be set either as an array or a map.
301301
@@ -319,7 +319,7 @@ build:
319319 - "com.example.label-with-empty-value"
320320` ` `
321321
322- # ## network
322+ # ## ` network`
323323
324324Set the network containers connect to for the `RUN` instructions during build.
325325
@@ -343,13 +343,13 @@ build:
343343 network: none
344344` ` `
345345
346- # ## no_cache
346+ # ## ` no_cache`
347347
348348` no_cache` disables image builder cache and enforces a full rebuild from source for all image layers. This only
349349applies to layers declared in the Dockerfile, referenced images can be retrieved from local image store whenever tag
350350has been updated on registry (see [pull](#pull)).
351351
352- # ## platforms
352+ # ## ` platforms`
353353
354354` platforms` defines a list of target [platforms](services.md#platform).
355355
@@ -368,8 +368,8 @@ When the `platforms` attribute is defined, Compose includes the service's
368368platform, otherwise users won't be able to run images they built.
369369
370370Composes reports an error in the following cases :
371- * When the list contains multiple platforms but the implementation is incapable of storing multi-platform images.
372- * When the list contains an unsupported platform.
371+ - When the list contains multiple platforms but the implementation is incapable of storing multi-platform images.
372+ - When the list contains an unsupported platform.
373373
374374 ` ` ` yml
375375 build:
@@ -378,7 +378,7 @@ Composes reports an error in the following cases:
378378 - "linux/amd64"
379379 - "unsupported/unsupported"
380380 ` ` `
381- * When the list is non-empty and does not contain the service's platform
381+ - When the list is non-empty and does not contain the service's platform.
382382
383383 ` ` ` yml
384384 services:
@@ -390,7 +390,7 @@ Composes reports an error in the following cases:
390390 - "linux/arm64"
391391 ` ` `
392392
393- # ## privileged
393+ # ## ` privileged`
394394
395395{{< introduced compose 2.15.0 "/manuals/compose/releases/release-notes.md#2" >}}
396396
@@ -402,12 +402,12 @@ build:
402402 privileged: true
403403` ` `
404404
405- # ## pull
405+ # ## ` pull`
406406
407407` pull` requires the image builder to pull referenced images (`FROM` Dockerfile directive), even if those are already
408408available in the local image store.
409409
410- # ## secrets
410+ # ## ` secrets`
411411
412412` secrets` grants access to sensitive data defined by [secrets](services.md#secrets) on a per-service build basis. Two
413413different syntax variants are supported : the short syntax and the long syntax.
@@ -446,8 +446,8 @@ the service's containers.
446446- `source` : The name of the secret as it exists on the platform.
447447- `target` : The name of the file to be mounted in `/run/secrets/` in the
448448 service's task containers. Defaults to `source` if not specified.
449- - `uid` and `gid` : The numeric UID or GID that owns the file within
450- ` /run/secrets/` in the service's task containers. Default value is USER running container .
449+ - `uid` and `gid` : The numeric uid or gid that owns the file within
450+ ` /run/secrets/` in the service's task containers. Default value is ` USER` .
451451- `mode` : The [permissions](https://wintelguy.com/permissions-calc.pl) for the file to be mounted in `/run/secrets/`
452452 in the service's task containers, in octal notation.
453453 Default value is world-readable permissions (mode `0444`).
@@ -478,7 +478,7 @@ Service builds may be granted access to multiple secrets. Long and short syntax
478478same Compose file. Defining a secret in the top-level `secrets` must not imply granting any service build access to it.
479479Such grant must be explicit within service specification as [secrets](services.md#secrets) service element.
480480
481- # ## ssh
481+ # ## ` ssh`
482482
483483` ssh` defines SSH authentications that the image builder should use during image build (e.g., cloning private repository).
484484
@@ -515,7 +515,7 @@ For illustration, [SSH mounts](https://github.com/moby/buildkit/blob/master/fron
515515RUN --mount=type=ssh,id=myproject git clone ...
516516` ` `
517517
518- # ## shm_size
518+ # ## ` shm_size`
519519
520520` shm_size` sets the size of the shared memory (`/dev/shm` partition on Linux) allocated for building Docker images. Specify
521521as an integer value representing the number of bytes or as a string expressing a [byte value](extension.md#specifying-byte-values).
@@ -532,7 +532,7 @@ build:
532532 shm_size: 10000000
533533` ` `
534534
535- # ## tags
535+ # ## ` tags`
536536
537537` tags` defines a list of tag mappings that must be associated to the build image. This list comes in addition to
538538the `image` [property defined in the service section](services.md#image)
@@ -543,7 +543,7 @@ tags:
543543 - "registry/username/myrepos:my-other-tag"
544544` ` `
545545
546- # ## target
546+ # ## ` target`
547547
548548` target` defines the stage to build as defined inside a multi-stage `Dockerfile`.
549549
@@ -553,11 +553,11 @@ build:
553553 target: prod
554554` ` `
555555
556- # ## ulimits
556+ # ## ` ulimits`
557557
558558{{< introduced compose 2.23.1 "/manuals/compose/releases/release-notes.md#2231" >}}
559559
560- ` ulimits` overrides the default ulimits for a container. It's specified either as an integer for a single limit
560+ ` ulimits` overrides the default ` ulimits` for a container. It's specified either as an integer for a single limit
561561or as mapping for soft/hard limits.
562562
563563` ` ` yml
@@ -571,5 +571,3 @@ services:
571571 soft: 20000
572572 hard: 40000
573573` ` `
574-
575-
0 commit comments