Skip to content

Commit fec983a

Browse files
authored
publish updates from main (#23003)
Automated pull request for publishing docs updates. --------- Co-authored-by: Allie Sadler <[email protected]>
2 parents f304bdb + 6d04fd7 commit fec983a

File tree

17 files changed

+173
-127
lines changed

17 files changed

+173
-127
lines changed

content/manuals/compose/bridge/_index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
description: Understand what Compose Bridge is and how it can be useful
3-
keywords: compose, orchestration, kubernetes, bridge
2+
description: Learn how Compose Bridge transforms Docker Compose files into Kubernetes manifests for seamless platform transitions
3+
keywords: docker compose bridge, compose to kubernetes, docker compose kubernetes integration, docker compose kustomize, compose bridge docker desktop
44
title: Overview of Compose Bridge
55
linkTitle: Compose Bridge
66
weight: 50
77
---
88

99
{{< summary-bar feature_name="Compose bridge" >}}
1010

11-
Compose Bridge lets you transform your Compose configuration file into configuration files for different platforms, primarily focusing on Kubernetes. The default transformation generates Kubernetes manifests and a Kustomize overlay which are designed for deployment on Docker Desktop with Kubernetes enabled.
11+
Compose Bridge converts your Docker Compose configuration into platform-specific formats—primarily Kubernetes manifests. The default transformation generates Kubernetes manifests and a Kustomize overlay which are designed for deployment on Docker Desktop with Kubernetes enabled.
1212

1313
It's a flexible tool that lets you either take advantage of the [default transformation](usage.md) or [create a custom transformation](customize.md) to suit specific project needs and requirements.
1414

content/manuals/compose/bridge/customize.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22
title: Customize Compose Bridge
33
linkTitle: Customize
44
weight: 20
5-
description: Learn about the Compose Bridge templates syntax
6-
keywords: compose, bridge, templates
5+
description: Learn how to customize Compose Bridge transformations using Go templates and Compose extensions
6+
keywords: docker compose bridge, customize compose bridge, compose bridge templates, compose to kubernetes, compose bridge transformation, go templates docker
7+
78
---
89

910
{{< summary-bar feature_name="Compose bridge" >}}
1011

11-
This page explains how Compose Bridge utilizes templating to efficiently translate Docker Compose files into Kubernetes manifests. It also explain how you can customize these templates for your specific requirements and needs, or how you can build your own transformation.
12+
This page explains how Compose Bridge utilizes templating to efficiently translate Docker Compose files into Kubernetes manifests. It also explains how you can customize these templates for your specific requirements and needs, or how you can build your own transformation.
1213

1314
## How it works
1415

1516
Compose bridge uses transformations to let you convert a Compose model into another form.
1617

1718
A transformation is packaged as a Docker image that receives the fully-resolved Compose model as `/in/compose.yaml` and can produce any target format file under `/out`.
1819

19-
Compose Bridge provides its transformation for Kubernetes using Go templates, so that it is easy to extend for customization by just replacing or appending your own templates.
20+
Compose Bridge includes a default Kubernetes transformation using Go templates, which you can customize by replacing or extending templates.
2021

2122
### Syntax
2223

23-
Compose Bridge make use of templates to transform a Compose configuration file into Kubernetes manifests. Templates are plain text files that use the [Go templating syntax](https://pkg.go.dev/text/template). This enables the insertion of logic and data, making the templates dynamic and adaptable according to the Compose model.
24+
Compose Bridge makes use of templates to transform a Compose configuration file into Kubernetes manifests. Templates are plain text files that use the [Go templating syntax](https://pkg.go.dev/text/template). This enables the insertion of logic and data, making the templates dynamic and adaptable according to the Compose model.
2425

2526
When a template is executed, it must produce a YAML file which is the standard format for Kubernetes manifests. Multiple files can be generated as long as they are separated by `---`
2627

@@ -44,7 +45,7 @@ key: value
4445

4546
### Input
4647

47-
The input Compose model is the canonical YAML model you can get by running `docker compose config`. Within the templates, data from the `compose.yaml` is accessed using dot notation, allowing you to navigate through nested data structures. For example, to access the deployment mode of a service, you would use `service.deploy.mode`:
48+
You can generate the input model by running `docker compose config`. This canonical YAML output serves as the input for Compose Bridge transformations. Within the templates, data from the `compose.yaml` is accessed using dot notation, allowing you to navigate through nested data structures. For example, to access the deployment mode of a service, you would use `service.deploy.mode`:
4849

4950
```yaml
5051
# iterate over a yaml sequence
@@ -86,7 +87,7 @@ In the following example, the template checks if a healthcheck interval is speci
8687
As Kubernetes is a versatile platform, there are many ways
8788
to map Compose concepts into Kubernetes resource definitions. Compose
8889
Bridge lets you customize the transformation to match your own infrastructure
89-
decisions and preferences, with various level of flexibility and effort.
90+
decisions and preferences, with varying level of flexibility and effort.
9091

9192
### Modify the default templates
9293

content/manuals/compose/bridge/usage.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
title: Use the default Compose Bridge transformation
33
linkTitle: Usage
44
weight: 10
5-
description: Learn about and use the Compose Bridge default transformation
6-
keywords: compose, bridge, kubernetes
5+
description: Learn how to use the default Compose Bridge transformation to convert Compose files into Kubernetes manifests
6+
keywords: docker compose bridge, compose kubernetes transform, kubernetes from compose, compose bridge convert, compose.yaml to kubernetes
77
---
88

99
{{< summary-bar feature_name="Compose bridge" >}}
1010

11-
Compose Bridge supplies an out-of-the box transformation for your Compose configuration file. Based on an arbitrary `compose.yaml` file, Compose Bridge produces:
11+
Compose Bridge supplies an out-of-the-box transformation for your Compose configuration file. Based on an arbitrary `compose.yaml` file, Compose Bridge produces:
1212

1313
- A [Namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) so all your resources are isolated and don't conflict with resources from other deployments.
1414
- A [ConfigMap](https://kubernetes.io/docs/concepts/configuration/configmap/) with an entry for each and every [config](/reference/compose-file/configs.md) resource in your Compose application.
@@ -34,7 +34,8 @@ $ docker compose bridge convert
3434

3535
Compose looks for a `compose.yaml` file inside the current directory and then converts it.
3636

37-
The following output is displayed
37+
When successful, Compose Bridge generates Kubernetes manifests and logs output similar to the following:
38+
3839
```console
3940
$ docker compose bridge convert -f compose.yaml
4041
Kubernetes resource api-deployment.yaml created
@@ -62,7 +63,7 @@ These files are then stored within your project in the `/out` folder.
6263
The Kubernetes manifests can then be used to run the application on Kubernetes using
6364
the standard deployment command `kubectl apply -k out/overlays/desktop/`.
6465

65-
> [!NOTE]
66+
> [!IMPORTANT]
6667
>
6768
> Make sure you have enabled Kubernetes in Docker Desktop before you deploy your Compose Bridge transformations.
6869
@@ -80,7 +81,7 @@ $ docker compose bridge convert --help
8081

8182
> [!TIP]
8283
>
83-
> You can now convert and deploy your Compose project to a Kubernetes cluster from the Compose file viewer.
84+
> You can convert and deploy your Compose project to a Kubernetes cluster from the Compose file viewer.
8485
>
8586
> Make sure you are signed in to your Docker account, navigate to your container in the **Containers** view, and in the top-right corner select **View configurations** and then **Convert and Deploy to Kubernetes**.
8687

content/manuals/compose/how-tos/dependent-images.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ weight: 50
88
{{< summary-bar feature_name="Compose dependent images" >}}
99

1010
To reduce push/pull time and image weight, a common practice for Compose applications is to have services
11-
share base layers as much as possible. You will typically select the same operating system base image for
11+
share base layers as much as possible. You typically select the same operating system base image for
1212
all services. But you can also get one step further by sharing image layers when your images share the same
1313
system packages. The challenge to address is then to avoid repeating the exact same Dockerfile instruction
1414
in all services.
@@ -162,3 +162,8 @@ Bake can also be selected as the default builder by editing your `$HOME/.docker/
162162
...
163163
}
164164
```
165+
166+
## Additional resources
167+
168+
- [Docker Compose build reference](/reference/cli/docker/compose/build.md)
169+
- [Learn about multi-stage Dockerfiles](/manuals/build/building/multi-stage.md)

content/manuals/compose/how-tos/environment-variables/_index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
title: Environment variables in Compose
33
linkTitle: Use environment variables
44
weight: 40
5-
description: Explainer on the ways to set, use and manage environment variables in
6-
Compose
5+
description: Explains how to set, use, and manage environment variables in Docker Compose.
76
keywords: compose, orchestration, environment, env file
87
aliases:
98
- /compose/environment-variables/
109
---
1110

12-
By leveraging environment variables and interpolation in Docker Compose, you can create versatile and reusable configurations, making your Dockerized applications easier to manage and deploy across different environments.
11+
Environment variables and interpolation in Docker Compose help you create reusable, flexible configurations. This makes Dockerized applications easier to manage and deploy across environments.
1312

1413
> [!TIP]
1514
>

content/manuals/compose/how-tos/environment-variables/envvars-precedence.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ aliases:
1212

1313
When the same environment variable is set in multiple sources, Docker Compose follows a precedence rule to determine the value for that variable in your container's environment.
1414

15-
This page contains information on the level of precedence each method of setting environmental variables takes.
15+
This page explains how Docker Compose determines the final value of an environment variable when it's defined in multiple locations.
1616

1717
The order of precedence (highest to lowest) is as follows:
1818
1. Set using [`docker compose run -e` in the CLI](set-environment-variables.md#set-environment-variables-with-docker-compose-run---env).
@@ -59,25 +59,25 @@ The columns `Host OS environment` and `.env` file is listed only for illustratio
5959

6060
Each row represents a combination of contexts where `VALUE` is set, substituted, or both. The **Result** column indicates the final value for `VALUE` in each scenario.
6161

62-
| # | `docker compose run` | `environment` attribute | `env_file` attribute | Image `ENV` | `Host OS` environment | `.env` file | | Result |
63-
|:--:|:----------------:|:-------------------------------:|:----------------------:|:------------:|:-----------------------:|:-----------------:|:---:|:----------:|
64-
| 1 | - | - | - | - | `VALUE=1.4` | `VALUE=1.3` || - |
65-
| 2 | - | - | `VALUE=1.6` | `VALUE=1.5` | `VALUE=1.4` | - ||**`VALUE=1.6`** |
66-
| 3 | - | `VALUE=1.7` | - | `VALUE=1.5` | `VALUE=1.4` | - ||**`VALUE=1.7`** |
67-
| 4 | - | - | - | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` ||**`VALUE=1.5`** |
68-
| 5 |`--env VALUE=1.8` | - | - | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` ||**`VALUE=1.8`** |
69-
| 6 |`--env VALUE` | - | - | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` ||**`VALUE=1.4`** |
70-
| 7 |`--env VALUE` | - | - | `VALUE=1.5` | - | `VALUE=1.3` ||**`VALUE=1.3`** |
71-
| 8 | - | - | `VALUE` | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` ||**`VALUE=1.4`** |
72-
| 9 | - | - | `VALUE` | `VALUE=1.5` | - | `VALUE=1.3` ||**`VALUE=1.3`** |
73-
| 10 | - | `VALUE` | - | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` ||**`VALUE=1.4`** |
74-
| 11 | - | `VALUE` | - | `VALUE=1.5` | - | `VALUE=1.3` ||**`VALUE=1.3`** |
75-
| 12 |`--env VALUE` | `VALUE=1.7` | - | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` ||**`VALUE=1.4`** |
76-
| 13 |`--env VALUE=1.8` | `VALUE=1.7` | - | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` ||**`VALUE=1.8`** |
77-
| 14 |`--env VALUE=1.8` | - | `VALUE=1.6` | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` ||**`VALUE=1.8`** |
78-
| 15 |`--env VALUE=1.8` | `VALUE=1.7` | `VALUE=1.6` | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` ||**`VALUE=1.8`** |
79-
80-
### Result explanation
62+
| # | `docker compose run` | `environment` attribute | `env_file` attribute | Image `ENV` | `Host OS` environment | `.env` file | Result |
63+
|:--:|:----------------:|:-------------------------------:|:----------------------:|:------------:|:-----------------------:|:-----------------:|:----------:|
64+
| 1 | - | - | - | - | `VALUE=1.4` | `VALUE=1.3` | - |
65+
| 2 | - | - | `VALUE=1.6` | `VALUE=1.5` | `VALUE=1.4` | - |**`VALUE=1.6`** |
66+
| 3 | - | `VALUE=1.7` | - | `VALUE=1.5` | `VALUE=1.4` | - |**`VALUE=1.7`** |
67+
| 4 | - | - | - | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` |**`VALUE=1.5`** |
68+
| 5 |`--env VALUE=1.8` | - | - | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` |**`VALUE=1.8`** |
69+
| 6 |`--env VALUE` | - | - | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` |**`VALUE=1.4`** |
70+
| 7 |`--env VALUE` | - | - | `VALUE=1.5` | - | `VALUE=1.3` |**`VALUE=1.3`** |
71+
| 8 | - | - | `VALUE` | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` |**`VALUE=1.4`** |
72+
| 9 | - | - | `VALUE` | `VALUE=1.5` | - | `VALUE=1.3` |**`VALUE=1.3`** |
73+
| 10 | - | `VALUE` | - | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` |**`VALUE=1.4`** |
74+
| 11 | - | `VALUE` | - | `VALUE=1.5` | - | `VALUE=1.3` |**`VALUE=1.3`** |
75+
| 12 |`--env VALUE` | `VALUE=1.7` | - | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` |**`VALUE=1.4`** |
76+
| 13 |`--env VALUE=1.8` | `VALUE=1.7` | - | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` |**`VALUE=1.8`** |
77+
| 14 |`--env VALUE=1.8` | - | `VALUE=1.6` | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` |**`VALUE=1.8`** |
78+
| 15 |`--env VALUE=1.8` | `VALUE=1.7` | `VALUE=1.6` | `VALUE=1.5` | `VALUE=1.4` | `VALUE=1.3` |**`VALUE=1.8`** |
79+
80+
### Understanding precedence results
8181

8282
Result 1: The local environment takes precedence, but the Compose file is not set to replicate this inside the container, so no such variable is set.
8383

@@ -87,7 +87,7 @@ Result 3: The `environment` attribute in the Compose file defines an explicit va
8787

8888
Result 4: The image's `ENV` directive declares the variable `VALUE`, and since the Compose file is not set to override this value, this variable is defined by image
8989

90-
Result 5: The `docker compose run` command has the `--env` flag set which an explicit value, and overrides the value set by the image.
90+
Result 5: The `docker compose run` command has the `--env` flag set with an explicit value, and overrides the value set by the image.
9191

9292
Result 6: The `docker compose run` command has the `--env` flag set to replicate the value from the environment. Host OS value takes precedence and is replicated into the container's environment.
9393

@@ -104,3 +104,8 @@ Result 11: The `environment` attribute in the Compose file is set to replicate `
104104
Result 12: The `--env` flag has higher precedence than the `environment` and `env_file` attributes and is to set to replicate `VALUE` from the local environment. Host OS value takes precedence and is replicated into the container's environment.
105105

106106
Results 13 to 15: The `--env` flag has higher precedence than the `environment` and `env_file` attributes and so sets the value.
107+
108+
## Next steps
109+
110+
- [Set environment variables in Compose](set-environment-variables.md)
111+
- [Use variable interpolation in Compose files](variable-interpolation.md)

0 commit comments

Comments
 (0)