Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed all docker-compose.y(a)ml to compose.yaml Fixes #6874 #6924

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bda266a
Update connect-nina-e2e.md - Renamed docker-compose.y(a)ml to compose…
alien299 Dec 15, 2023
cb3d295
Update inspecting-containers.md - Renamed docker-compose.y(a)ml to co…
alien299 Dec 15, 2023
df9170a
Update docker-compose.md - Renamed docker-compose.y(a)ml to compose.yaml
alien299 Dec 15, 2023
2491003
Update overview.md - Renamed docker-compose.y(a)ml to compose.yaml
alien299 Dec 15, 2023
5679fd8
Update quickstart-node.md - Renamed docker-compose.y(a)ml to compose.…
alien299 Dec 15, 2023
a768e36
Update quickstart-python.md - Renamed docker-compose.y(a)ml to compos…
alien299 Dec 15, 2023
209f3ab
Update reference.md - Renamed docker-compose.y(a)ml to compose.yaml
alien299 Dec 15, 2023
0f66804
Update containers.md - Renamed docker-compose.y(a)ml to compose.yaml
alien299 Dec 15, 2023
5924776
Update create-dev-container.md - Renamed docker-compose.y(a)ml to com…
alien299 Dec 15, 2023
52e5235
Update tips-and-tricks.md - Renamed docker-compose.y(a)ml to compose.…
alien299 Dec 15, 2023
957aa42
Update tutorial.md - Renamed docker-compose.y(a)ml to compose.yaml
alien299 Dec 15, 2023
16c2f23
Update v1_35.md - Renamed docker-compose.y(a)ml to compose.yaml
alien299 Dec 15, 2023
a36ce16
Update v1_38.md - Renamed docker-compose.y(a)ml to compose.yaml
alien299 Dec 15, 2023
a6ffe42
Update v1_39.md - Renamed docker-compose.y(a)ml to compose.yaml
alien299 Dec 15, 2023
66da5ca
Update add-local-file-mount.md - Renamed docker-compose.y(a)ml to com…
alien299 Dec 15, 2023
1278a23
Update add-nonroot-user.md - Renamed docker-compose.y(a)ml to compose…
alien299 Dec 15, 2023
7a728a3
Update connect-multiple-containers.md - Renamed docker-compose.y(a)ml…
alien299 Dec 15, 2023
8057243
Update develop-remote-host.md - Renamed docker-compose.y(a)ml to comp…
alien299 Dec 15, 2023
06151c9
Update environment-variables.md - Renamed docker-compose.y(a)ml to co…
alien299 Dec 15, 2023
4eb4fa5
Update improve-performance.md - Renamed docker-compose.y(a)ml to comp…
alien299 Dec 15, 2023
8a4a24a
Update persist-bash-history.md - Renamed docker-compose.y(a)ml to com…
alien299 Dec 15, 2023
bd405f9
Merge branch 'main' into Rename-all-docker-compose.y(a)ml-to-compose.…
alien299 Dec 20, 2023
10c50b6
Merge branch 'main' into Rename-all-docker-compose.y(a)ml-to-compose.…
alien299 Jan 5, 2024
288a376
Merge branch 'main' into Rename-all-docker-compose.y(a)ml-to-compose.…
alien299 Jan 20, 2024
b7231e4
Merge branch 'main' into Rename-all-docker-compose.y(a)ml-to-compose.…
alien299 Feb 26, 2024
5b82ad7
Merge branch 'main' into Rename-all-docker-compose.y(a)ml-to-compose.…
alien299 Mar 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions blogs/2017/01/15/connect-nina-e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,15 @@ Switch back to the extensions tab, search for `docker` and select the Microsoft

<img src="/assets/blogs/2017/01/15/DockerSearch.png" width="350px" />

This extension includes many things, one of which is a simple command for generating a `Dockerfile` and `docker-compose.yml` file for an existing project. To see this in action, type `F1` (to bring up the command palette) and type `docker` to display all of the commands that the Docker extension provides:
This extension includes many things, one of which is a simple command for generating a `Dockerfile` and `compose.yaml` file for an existing project. To see this in action, type `F1` (to bring up the command palette) and type `docker` to display all of the commands that the Docker extension provides:

<img src="/assets/blogs/2017/01/15/DockerCommands.png" width="350px" />

Select the `Docker: Add docker files to workspace` command, select `Node.js` as the app platform, and specify that the app exposes port `8080`. This generates a complete `Dockerfile` and Docker compose files that you can begin using immediately.

<img src="/assets/blogs/2017/01/15/Dockerfile.png" width="450px" />

The Docker extension also provides auto-completion for your `Dockerfiles` and `docker-compose.yml` files, which makes authoring your Docker assets a lot simpler. For example, open up the `Dockerfile` and change line 2 from:
The Docker extension also provides auto-completion for your `Dockerfiles` and `compose.yaml` files, which makes authoring your Docker assets a lot simpler. For example, open up the `Dockerfile` and change line 2 from:

```docker
FROM node:latest
Expand Down
6 changes: 3 additions & 3 deletions blogs/2019/10/31/inspecting-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The first thing we need is an application that we can run in a container. If you
git clone https://github.com/microsoft/vscode-express-sample.git
```

This application has a simple Dockerfile that is based off the Node 10 image, as well as a `docker-compose.yml` file that we will use to run the image, expose the appropriate ports, and map in the local file system. We are running Node with the `–inspect` flag so that we can debug the app as we would when running locally. In a real application, you would probably want a separate Docker Compose file for your production deployment.
This application has a simple Dockerfile that is based off the Node 10 image, as well as a `compose.yaml` file that we will use to run the image, expose the appropriate ports, and map in the local file system. We are running Node with the `–inspect` flag so that we can debug the app as we would when running locally. In a real application, you would probably want a separate Docker Compose file for your production deployment.

>**Note**: You don't need a Docker Compose file, you can also attach to containers created with a single Dockerfile.

Expand Down Expand Up @@ -80,7 +80,7 @@ Let's go ahead and open our app by selecting the **Open Folder** button and navi

![Open Folder dialog show container file system](open-folder-dialog.png)

Once you have opened your source folder, you'll notice that a file has been opened in your editor with the file name `express-server.json`. This name is derived from the container image name that you have attached to. In our example, docker-compose creates the image name 'express_server', which is derived from the folder name `express` and the service name `server` defined in the `docker-compose.yml` file. This file is a configuration file associated with your image that will remember configuration settings when you attach to containers based on this image. If you don't have Auto Save on, you'll need to make sure to save this file. Now in future sessions, VS Code will reopen this source folder when you attach to this image.
Once you have opened your source folder, you'll notice that a file has been opened in your editor with the file name `express-server.json`. This name is derived from the container image name that you have attached to. In our example, docker-compose creates the image name 'express_server', which is derived from the folder name `express` and the service name `server` defined in the `compose.yaml` file. This file is a configuration file associated with your image that will remember configuration settings when you attach to containers based on this image. If you don't have Auto Save on, you'll need to make sure to save this file. Now in future sessions, VS Code will reopen this source folder when you attach to this image.

>**Note**: You can view this file for the current dev container by running the command **Open Container Configuration File** from the Command Palette (`kb(workbench.action.showCommands)`).

Expand All @@ -96,7 +96,7 @@ For example, open `app.js`. Right click on line 8 and execute **Find All Referen

## Debug inside the container

To further show how similar the dev container is to a local environment, let's attach a debugger. We started our Node app with the `–inspect` parameter in `docker-compose.yaml`, so all we have to do is attach a debugger to that process.
To further show how similar the dev container is to a local environment, let's attach a debugger. We started our Node app with the `–inspect` parameter in `compose.yaml`, so all we have to do is attach a debugger to that process.

In the Command Palette (`kb(workbench.action.showCommands)`), search for and select **Debug: Attach to Node Process**. There will probably be several Node processes running inside the container. We want the process that is running our application, so select the one that shows `bin/www`.

Expand Down
30 changes: 15 additions & 15 deletions docs/containers/docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ If you already have one or more Dockerfiles, you can add Docker Compose files by

You can add Docker Compose files to your workspace at the same time you add a Dockerfile by opening the **Command Palette** (`kb(workbench.action.showCommands)`) and using the **Docker: Add Docker Files to Workspace** command. You'll be asked if you want to add Docker Compose files. If you want to keep your existing Dockerfile, choose **No** when prompted to overwrite the Dockerfile.

The Docker extension adds the `docker-compose.yml` file to your workspace. This file contains the configuration to bring up the containers as expected in production. In some cases, a `docker-compose.debug.yml` is also generated. This file provides a simplified mode for starting that enables the debugger.
The Docker extension adds the `compose.yaml` file to your workspace. This file contains the configuration to bring up the containers as expected in production. In some cases, a `docker-compose.debug.yml` is also generated. This file provides a simplified mode for starting that enables the debugger.

![Screenshot of project with docker-compose files](images/compose/docker-compose-files.png)

The VS Code Docker extension generates files that work out of the box, but you can also customize them to optimize for your scenario. You can then use the **Docker Compose Up** command (right-click on the `docker-compose.yml` file, or find the command in the **Command Palette**) to get everything started at once. You can also use the `docker-compose up` command from the command prompt or terminal window in VS Code to start the containers. Refer to the [Docker Compose documentation](https://docs.docker.com/compose/reference/up) about how to configure the Docker Compose behavior and what command-line options are available.
The VS Code Docker extension generates files that work out of the box, but you can also customize them to optimize for your scenario. You can then use the **Docker Compose Up** command (right-click on the `compose.yaml` file, or find the command in the **Command Palette**) to get everything started at once. You can also use the `docker-compose up` command from the command prompt or terminal window in VS Code to start the containers. Refer to the [Docker Compose documentation](https://docs.docker.com/compose/reference/up) about how to configure the Docker Compose behavior and what command-line options are available.

With the docker-compose files, you can now specify port mappings in the docker-compose files, rather than in the .json configuration files. For examples, see the [Docker Compose documentation](https://docs.docker.com/compose/compose-file/#ports).

> **Tip**: When using Docker Compose, don't specify a host port. Instead, let the Docker pick a random available port to automatically avoid port conflict issues.

## Add new containers to your projects

If you want to add another app or service, you can run **Add Docker Compose Files to Workspace** again, and choose to overwrite the existing docker-compose files, but you'll lose any customization in those files. If you want to preserve changes to the compose files, you can manually modify the `docker-compose.yml` file to add the new service. Typically, you can copy the existing service section, paste it to create a new entry, and change the names as appropriate for the new service.
If you want to add another app or service, you can run **Add Docker Compose Files to Workspace** again, and choose to overwrite the existing docker-compose files, but you'll lose any customization in those files. If you want to preserve changes to the compose files, you can manually modify the `compose.yaml` file to add the new service. Typically, you can copy the existing service section, paste it to create a new entry, and change the names as appropriate for the new service.

You can run the **Add Docker Files to Workspace** command again to generate the `Dockerfile` for a new app. While each app or service has its own Dockerfile, there's typically one `docker-compose.yml` and one `docker-compose.debug.yml` file per workspace.
You can run the **Add Docker Files to Workspace** command again to generate the `Dockerfile` for a new app. While each app or service has its own Dockerfile, there's typically one `compose.yaml` and one `docker-compose.debug.yml` file per workspace.

In Python projects, you have the `Dockerfile`, `.dockerignore`, `docker-compose*.yml` files all in the root folder of the workspace. When you add another app or service, move the Dockerfile into the app's folder.

Expand Down Expand Up @@ -132,7 +132,7 @@ For debugging Python with Docker Compose, follow these steps:

1. When done editing the **Attach** configuration, save the `launch.json`. Navigate to the **Debug** tab, and select **Python Debugger: Remote Attach** as the active configuration.

1. If you already have a valid Dockerfile, we recommend running the command **Docker: Add Docker Compose Files to Workspace**. This will create a `docker-compose.yml` file and also a `docker-compose.debug.yml`, which volume maps and starts the Python debugger in the container. If you do not have a Dockerfile already, we recommend running **Docker: Add Docker Files to Workspace** and selecting **Yes** to include Docker Compose files.
1. If you already have a valid Dockerfile, we recommend running the command **Docker: Add Docker Compose Files to Workspace**. This will create a `compose.yaml` file and also a `docker-compose.debug.yml`, which volume maps and starts the Python debugger in the container. If you do not have a Dockerfile already, we recommend running **Docker: Add Docker Files to Workspace** and selecting **Yes** to include Docker Compose files.

> **Note**: By default, when using **Docker: Add Docker Files to Workspace**, choosing the Django and Flask options will scaffold a Dockerfile configured for Gunicorn. Follow the instructions in the [Python in a container quickstart](/docs/containers/quickstart-python.md#gunicorn-modifications-for-django-and-flask-apps) to ensure it is configured properly before proceeding.

Expand Down Expand Up @@ -218,21 +218,21 @@ volumes:

Workspaces can have multiple docker-compose files to handle different environments like development, test, and production. The content of the configuration can be split into multiple files. For example, a base compose file that defines the common information for all environments and separate override files that define environment-specific information. When these files are passed as input to the `docker-compose` command, it combines these files into a single configuration. By default, the **Docker: Compose Up** command passes a single file as input to the compose command, but you can customize the `compose up` command to pass in multiple files using [command customization](/docs/containers/reference.md#command-customization). Or, you can use a [custom task](/docs/editor/tasks.md#custom-tasks) to invoke the `docker-compose` command with the desired parameters.

> **Note**: If your workspace has `docker-compose.yml` and `docker-compose.override.yml` and no other compose files, then the `docker-compose` command is invoked with no input files and it implicitly uses these files. In this case, no customization is needed.
> **Note**: If your workspace has `compose.yaml` and `docker-compose.override.yml` and no other compose files, then the `docker-compose` command is invoked with no input files and it implicitly uses these files. In this case, no customization is needed.

## Command customization

[Command customization](/docs/containers/reference.md#command-customization) provides various ways to customize the `compose up` command based on your requirements. The following are few sample command customization for the `compose up` command.

### Base file and an override file

Let's assume your workspace has a base compose file (`docker-compose.yml`) and an override file for each environment (`docker-compose.dev.yml`, `docker-compose.test.yml` and `docker-compose.prod.yml`) and you always run `docker compose up` with the base file and an override file. In this case, the `compose up` command can be customized as in the following example. When the `compose up` command is invoked, the `${configurationFile}` is replaced by the selected file.
Let's assume your workspace has a base compose file (`compose.yaml`) and an override file for each environment (`docker-compose.dev.yml`, `docker-compose.test.yml` and `docker-compose.prod.yml`) and you always run `docker compose up` with the base file and an override file. In this case, the `compose up` command can be customized as in the following example. When the `compose up` command is invoked, the `${configurationFile}` is replaced by the selected file.

```json
"docker.commands.composeUp": [
{
"label": "override",
"template": "docker-compose -f docker-compose.yml ${configurationFile} up -d --build",
"template": "docker-compose -f compose.yaml ${configurationFile} up -d --build",
}
]
```
Expand All @@ -245,17 +245,17 @@ Let's assume you have a different set of input files for each environment. You c
"docker.commands.composeUp": [
{
"label": "dev-match",
"template": "docker-compose -f docker-compose.yml -f docker-compose.debug.yml -f docker-compose.dev.yml up -d --build",
"template": "docker-compose -f compose.yaml -f docker-compose.debug.yml -f docker-compose.dev.yml up -d --build",
"match": "dev"
},
{
"label": "test-match",
"template": "docker-compose -f docker-compose.yml -f docker-compose.debug.yml -f docker-compose.test.yml up -d --build",
"template": "docker-compose -f compose.yaml -f docker-compose.debug.yml -f docker-compose.test.yml up -d --build",
"match": "test"
},
{
"label": "prod-match",
"template": "docker-compose -f docker-compose.yml -f docker-compose.release.yml -f docker-compose.prod.yml up -d --build",
"template": "docker-compose -f compose.yaml -f docker-compose.release.yml -f docker-compose.prod.yml up -d --build",
"match": "prod"
}
]
Expand All @@ -269,15 +269,15 @@ If you omit the `match` property from command templates, you're asked which temp
"docker.commands.composeUp": [
{
"label": "dev",
"template": "docker-compose -f docker-compose.yml -f docker-compose.common.dev.yml ${configurationFile} up -d --build"
"template": "docker-compose -f compose.yaml -f docker-compose.common.dev.yml ${configurationFile} up -d --build"
},
{
"label": "test",
"template": "docker-compose -f docker-compose.yml -f docker-compose.common.test.yml ${configurationFile} up -d --build"
"template": "docker-compose -f compose.yaml -f docker-compose.common.test.yml ${configurationFile} up -d --build"
},
{
"label": "prod",
"template": "docker-compose -f docker-compose.yml -f docker-compose.common.prod.yml ${configurationFile} up -d --build"
"template": "docker-compose -f compose.yaml -f docker-compose.common.prod.yml ${configurationFile} up -d --build"
},
],
```
Expand All @@ -290,7 +290,7 @@ Rather than use command customization, you can also define a task like the follo
{
"type": "shell",
"label": "compose-up-dev",
"command": "docker-compose -f docker-compose.yml -f docker-compose.Common.yml -f docker-compose.dev.yml up -d --build",
"command": "docker-compose -f compose.yaml -f docker-compose.Common.yml -f docker-compose.dev.yml up -d --build",
"presentation": {
"reveal": "always",
"panel": "new"
Expand Down
6 changes: 3 additions & 3 deletions docs/containers/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ To install the extension, open the Extensions view (`kb(workbench.view.extension

## Editing Docker files

You can get [IntelliSense](/docs/editor/intellisense.md) by clicking `kb(editor.action.triggerSuggest)` when editing your `Dockerfile` and `docker-compose.yml` files, with completions and syntax help for common commands.
You can get [IntelliSense](/docs/editor/intellisense.md) by clicking `kb(editor.action.triggerSuggest)` when editing your `Dockerfile` and `compose.yaml` files, with completions and syntax help for common commands.

![IntelliSense for Dockerfiles](images/overview/dockerfile-intellisense.png)

In addition, you can use the Problems panel (`kb(workbench.actions.view.problems)`) to view common errors for `Dockerfile` and `docker-compose.yml` files.
In addition, you can use the Problems panel (`kb(workbench.actions.view.problems)`) to view common errors for `Dockerfile` and `compose.yaml` files.

## Generating Docker files

Expand Down Expand Up @@ -59,7 +59,7 @@ You can run Docker commands to manage [images](https://docs.docker.com/engine/re

## Docker Compose

[Docker Compose](https://docs.docker.com/compose/) lets you define and run multi-container applications with Docker. Our [Compose Language Service](https://github.com/microsoft/compose-language-service) in the Docker extension gives you IntelliSense and tab completions when authoring `docker-compose.yml` files. Press `kb(editor.action.triggerSuggest)` to see a list of valid Compose directives.
[Docker Compose](https://docs.docker.com/compose/) lets you define and run multi-container applications with Docker. Our [Compose Language Service](https://github.com/microsoft/compose-language-service) in the Docker extension gives you IntelliSense and tab completions when authoring `compose.yaml` files. Press `kb(editor.action.triggerSuggest)` to see a list of valid Compose directives.

![Docker Compose IntelliSense](images/overview/tab-completions.gif)

Expand Down
Loading