Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 6762209

Browse files
committed
Update READMEs
1 parent 0d50049 commit 6762209

File tree

7 files changed

+190
-101
lines changed

7 files changed

+190
-101
lines changed

containers/azure-functions-dotnetcore-2.1/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
This definition requires an Azure subscription to use. You can create a [free account here](https://azure.microsoft.com/en-us/free/serverless/) and learn more about using [Azure Functions with VS Code here](https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-vs-code). Once you have an Azure account, follow these steps:
1616

17-
1817
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
1918

2019
2. To use VS Code's copy of this definition:

containers/docker-existing-docker-compose/README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,34 @@
1212

1313
> **Note:** There is also a single [Dockerfile](../docker-existing-dockerfile) variation of this same definition.
1414
15-
## Usage
15+
## Using this definition with an existing folder
1616

17-
To use the definition with an existing project that contains a `docker-compose.yml` file:
17+
This definition requires an existing `docker-compose.yml` file that you would prefer not to modify but still want to add additional ports, a volume mount, or override the default command so that the container does not shut down if you stop the application. The `.devcontainer/docker-compose.yml` and `.devcontainer/devcontainer.json` file will needs to be modified for your scenario.
1818

19-
1. Copy the `.devcontainer` folder into your project root.
20-
2. Modify the `.devcontainer/dev-container.yml` and `devcontainer.json` files as needed (see comments)
21-
3. Reopen the folder in the container (e.g. using the **Remote-Container: Reopen Folder in Container** command in VS Code) to use it unmodified.
19+
Follow these steps to use it:
2220

23-
[See here for more information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open).
21+
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
22+
23+
2. To use VS Code's copy of this definition:
24+
1. Start VS Code and open your project folder.
25+
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
26+
3. Select the Existing Docker Compose (Extend) definition.
27+
28+
3. To use latest-and-greatest copy of this definition from the repository:
29+
1. Clone this repository.
30+
2. Copy the contents of `containers/docker-existing-docker-compose/.devcontainer` to the root of your project folder.
31+
3. Start VS Code and open your project folder.
32+
33+
4. After following step 2 or 3, you will need to modify the following files in `.devcontainer` folder that was added to your project:
34+
1. Update `your-service-name-here` in both the `docker-compose.yml` file and `devcontainer.json` to the name of the service you want to extend.
35+
2. Update the `volume` mapping in `docker-compose.yml` to point to your source code location and the `workspacePath` in `devcontainer.json` to match it.
36+
3. Each file has some information on additional settings to consider.
37+
38+
5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.
2439

25-
If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project.
2640
## License
2741

2842
Copyright (c) Microsoft Corporation. All rights reserved.
2943

30-
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).
44+
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE)
45+

containers/docker-existing-dockerfile/.devcontainer/devcontainer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
// "See https://aka.ms/vscode-remote/devcontainer.json for format details."
33
"name": "Existing Dockerfile",
44

5+
// "Sets the run context to one level up instead of the .devcontainer folder.
6+
"context": "..",
7+
58
// "Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename."
6-
"dockerFile": "../Dockerfile",
9+
"dockerFile": "Dockerfile",
710

811
// "Use the optional 'appPort' property to expose ports not already in your Dockerfile"
912
"appPort": [],
@@ -13,7 +16,7 @@
1316

1417
// "The optional 'runArgs' property can be used to specify Docker CLI arguments to use when the container."
1518
// "is started. If you install the Docker CE CLI in your container, the runArgs list below will lets you interact"
16-
// "with your host's Docker service from inside the container. See the docker-in-docker and docker-in-docker-compose"
19+
// "with your host's Docker service from inside the container. See the docker-in-docker and docker-in-docker"
1720
// "definitions for details."
1821
"runArgs": ["-v","/var/run/docker.sock:/var/run/docker.sock"]
1922
}

containers/docker-existing-dockerfile/README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,27 @@
1212

1313
> **Note:** There is also a [Docker Compose](../docker-existing-docker-compose) variation of this same definition.
1414
15-
## Usage
15+
## Using this definition with an existing folder
1616

17-
To use the definition with your own project that contains a `Dockerfile`:
17+
This definition requires an existing `Dockerfile` in your project and outlines some settings in `.devcontainer/devcontainer.json` to consider when reusing one.
1818

19-
1. Copy the `.devcontainer` folder into your project root.
20-
2. Modify the `.devcontainer/devcontainer.json` as needed (see comments)
21-
3. Reopen the folder in the container (e.g. using the **Remote-Container: Reopen Folder in Container** command in VS Code) to use it unmodified.
19+
Follow these steps to use it:
2220

23-
[See here for more information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open).
21+
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
22+
23+
2. To use VS Code's copy of this definition:
24+
1. Start VS Code and open your project folder.
25+
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
26+
3. Select the Existing Dockerfile definition.
27+
28+
3. To use latest-and-greatest copy of this definition from the repository:
29+
1. Clone this repository.
30+
2. Copy the contents of `containers/docker-existing-dockerfile/.devcontainer` to the root of your project folder.
31+
3. Start VS Code and open your project folder.
32+
33+
4. After following step 2 or 3, review the settings and comments in the `.devcontainer/devcontainer.json` file added to your project. Comments in the file will help you expose new ports, install extensions, forward the Docker socket, and more.
34+
35+
5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.
2436

2537
## License
2638

containers/docker-in-docker-compose/README.md

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,59 @@
1616

1717
Dev containers can be useful for all types of applications including those that also deploy into a container based-environment. While you can directly build and run the application inside the dev container you create, you may also want to test it by deploying a built container image into your local Docker Desktop instance without affecting your dev container. This example illustrates how you can do this by running CLI commands and using the [Docker VS Code extension](https://marketplace.visualstudio.com/items?itemName=PeterJausovec.vscode-docker) right from inside your dev container.
1818

19-
## Usage
19+
## How it works / adapting your existing dev container config
2020

21-
[See here for information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open).
21+
You can adapt your own existing development container Docker Compose setup to support this scenario by following these steps:
2222

23-
If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project.
24-
25-
```Dockerfile
26-
FROM node:8
27-
```
28-
29-
See the [Docker CE installation steps for Linux](https://docs.docker.com/install/linux/docker-ce/debian/) for details on other distributions. Note that you only need the Docker CLI in this particular case.
30-
31-
## How it works
32-
33-
The trick that makes this work is as follows:
34-
35-
1. First, install the Docker CLI in the container. From `.devcontainer/Dockerfile`:
23+
1. First, install the Docker CLI in your dev container. From `.devcontainer/Dockerfile`:
3624

3725
```Dockerfile
38-
RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \
26+
RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \
3927
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - \
4028
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
4129
&& apt-get update \
4230
&& apt-get install -y docker-ce-cli
4331
```
4432

45-
2. Then just forward the Docker socket by mounting it in the container. From `.devcontainer/docker-compose.yml`:
33+
2. Then just forward the Docker socket by mounting it in the container in your Docker Compose config. From `.devcontainer/docker-compose.yml`:
4634

4735
```yaml
4836
volumes:
4937
- /var/run/docker.sock:/var/run/docker.sock
5038
```
5139

40+
3. Press <kbd>F1</kbd> and run **Remote-Containers: Rebuild Container** so the changes take effect.
41+
5242
That's it!
5343
44+
## Using this definition with an existing folder
45+
46+
There are no special setup steps are required, but note that the included `.devcontainer/Dockerfile` can be altered to work with other Debian/Ubuntu-based container images such as `node` or `python`. Just, update the `FROM` statement to reference the new base image. For example:
47+
48+
```Dockerfile
49+
FROM node:8
50+
```
51+
52+
Beyond that, just follow these steps to use the definition:
53+
54+
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
55+
56+
2. To use VS Code's copy of this definition:
57+
1. Start VS Code and open your project folder.
58+
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
59+
3. Select the Docker in Docker Compose definition.
60+
61+
3. To use latest-and-greatest copy of this definition from the repository:
62+
1. Clone this repository.
63+
2. Copy the contents of `containers/docker-in-docker-compose/.devcontainer` to the root of your project folder.
64+
3. Start VS Code and open your project folder.
65+
66+
4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.
67+
68+
5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.
69+
5470
## License
5571

5672
Copyright (c) Microsoft Corporation. All rights reserved.
5773

58-
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).
74+
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).

containers/docker-in-docker/README.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,60 @@
1616

1717
Dev containers can be useful for all types of applications including those that also deploy into a container based-environment. While you can directly build and run the application inside the dev container you create, you may also want to test it by deploying a built container image into your local Docker Desktop instance without affecting your dev container. This example illustrates how you can do this by running CLI commands and using the [Docker VS Code extension](https://marketplace.visualstudio.com/items?itemName=PeterJausovec.vscode-docker) right from inside your dev container.
1818

19-
## Usage
19+
## How it works / adapting your existing dev container config
2020

21-
[See here for information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open).
21+
You can adapt your own existing development container Dockerfile to support this scenario by following these steps:
2222

23-
If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project.
24-
25-
No additional setup steps are required, but note that the included `.devcontainer/Dockerfile` can be altered to work with other Debian/Ubuntu-based container images such as `node` or `python`. First, update the `FROM` statement to reference the new base image. For example:
26-
27-
```Dockerfile
28-
FROM node:8
29-
```
30-
31-
See the [Docker CE installation steps for Linux](https://docs.docker.com/install/linux/docker-ce/debian/) for details on other distributions. Note that you only need the Docker CLI in this particular case.
32-
33-
## How it works
34-
35-
The trick that makes this work is as follows:
36-
37-
1. First, install the Docker CLI in the container. From `.devcontainer/Dockerfile`:
23+
1. First, install the Docker CLI in your container. From `.devcontainer/Dockerfile`:
3824

3925
```Dockerfile
4026
# Install Docker CE CLI
41-
RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \
27+
RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release \
4228
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - \
4329
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" \
4430
&& apt-get update \
4531
&& apt-get install -y docker-ce-cli
4632

4733
```
4834

49-
2. Then just forward the Docker socket by mounting it in the container. From `.devcontainer/devcontainer.json`:
35+
2. Then just forward the Docker socket by mounting it in the container using `runArgs`. From `.devcontainer/devcontainer.json`:
5036

5137
```json
5238
"runArgs": ["-v","/var/run/docker.sock:/var/run/docker.sock"]
5339
```
5440

41+
3. Press <kbd>F1</kbd> and run **Remote-Containers: Rebuild Container** so the changes take effect.
42+
5543
That's it!
5644
45+
## Using this definition with an existing folder
46+
47+
There are no special setup steps are required, but note that the included `.devcontainer/Dockerfile` can be altered to work with other Debian/Ubuntu-based container images such as `node` or `python`. Just, update the `FROM` statement to reference the new base image. For example:
48+
49+
```Dockerfile
50+
FROM node:8
51+
```
52+
53+
Beyond that, just follow these steps to use the definition:
54+
55+
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
56+
57+
2. To use VS Code's copy of this definition:
58+
1. Start VS Code and open your project folder.
59+
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
60+
3. Select the Docker in Docker definition.
61+
62+
3. To use latest-and-greatest copy of this definition from the repository:
63+
1. Clone this repository.
64+
2. Copy the contents of `containers/docker-in-docker/.devcontainer` to the root of your project folder.
65+
3. Start VS Code and open your project folder.
66+
67+
4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.
68+
69+
5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.
70+
5771
## License
5872

5973
Copyright (c) Microsoft Corporation. All rights reserved.
6074

61-
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).
75+
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).

0 commit comments

Comments
 (0)