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

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed Mar 24, 2019
2 parents 31133be + a40ec20 commit c8f0410
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions containers/docker-in-docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

## Summary

*Illustrates how you can use it to access your local Docker install from inside the a dev container by simply volume mounting the Docker unix socket. This variation uses Docker Compose to do the volume mounting.*

> **Note:** You can also check out the [Dockerfile](../docker-in-docker) variation of this same definition.
*Illustrates how you can use it to access your local Docker install from inside a dev container by simply volume mounting the Docker unix socket. This variation uses Docker Compose to do the volume mounting.*

| Metadata | Value |
|----------|-------|
| *Contributors* | The VS Code team |
| *Definition type* | Docker Compose |
| *Languages, platforms* | Any |

> **Note:** There is also a single [Dockerfile](../docker-in-docker) variation of this same definition.
## Description

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.
Expand Down Expand Up @@ -42,7 +42,7 @@ See the [Docker CE installation steps for Linux](https://docs.docker.com/install

The trick that makes this work is as follows:

1. Install the Docker CLI in the container. From `dev-container.dockerfile`:
1. First, install the Docker CLI in the container. From `dev-container.dockerfile`:

```Dockerfile
# Install Docker CE CLI
Expand All @@ -52,7 +52,7 @@ The trick that makes this work is as follows:
&& apt-get update \
&& apt-get install -y docker-ce-cli
```
2. Forward the Docker socket. From `docker-compose.dev-container.yml`:
2. Then just forward the Docker socket by mounting it in the container. From `docker-compose.dev-container.yml`:

```yaml
volumes:
Expand Down
12 changes: 6 additions & 6 deletions containers/docker-in-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

## Summary

*Illustrates how you can use it to access your local Docker install from inside the a dev container by simply volume mounting the Docker unix socket. This variation uses `runArgs` and a `Dockerfile` to do the volume mounting*

> **Note:** You can also check out the [Docker Compose](../docker-in-docker-compose) variation of this same definition.
*Illustrates how you can use it to access your local Docker install from inside a dev container by simply volume mounting the Docker unix socket. This variation uses `runArgs` in `devContainer.json` to do the volume mounting.*

| Metadata | Value |
|----------|-------|
| *Contributors* | The VS Code team |
| *Definition type* | Dockerfile |
| *Languages, platforms* | Any |

> **Note:** There is also a [Docker Compose](../docker-in-docker-compose) variation of this same definition.
## Description

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.
Expand Down Expand Up @@ -42,7 +42,7 @@ See the [Docker CE installation steps for Linux](https://docs.docker.com/install

The trick that makes this work is as follows:

1. Install the Docker CLI in the container. From `dev-container.dockerfile`:
1. First, install the Docker CLI in the container. From `dev-container.dockerfile`:

```Dockerfile
# Install Docker CE CLI
Expand All @@ -52,10 +52,10 @@ The trick that makes this work is as follows:
&& apt-get update \
&& apt-get install -y docker-ce-cli
```
2. Forward the Docker socket. From `devContainer.json`:
2. Then just forward the Docker socket by mounting it in the container. From `devContainer.json`:

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

That's it!
That's it!
8 changes: 4 additions & 4 deletions containers/kubernetes-helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Summary

*Illustrates how you access a Kubernetes cluster from inside a dev container. Includes the Docker CLI, kubectl, and Helm.*
*Illustrates how you can access a local (or remote) Kubernetes cluster from inside a dev container. Includes the Docker CLI, kubectl, and Helm.*

| Metadata | Value |
|----------|-------|
Expand Down Expand Up @@ -87,7 +87,7 @@ To get started, follow the appropriate steps below for your operating system.

The trick that makes this work is as follows:

1. Install all of the needed CLIs in the container. From `dev-container.dockerfile`:
1. First, install all of the needed CLIs in the container. From `dev-container.dockerfile`:

```Dockerfile
# Install Docker CE CLI
Expand All @@ -107,15 +107,15 @@ The trick that makes this work is as follows:
RUN curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash -
```

2. Forward the local Docker socket and mount the local `.kube` folder in the container so the configuration can be reused. From `devContainer.json`:
2. Next, forward the local Docker socket and mount the local `.kube` folder in the container so the configuration can be reused. From `devContainer.json`:

```json
"runArgs": ["-e", "SYNC_LOCALHOST_KUBECONFIG=true",
"-v", "/var/run/docker.sock:/var/run/docker.sock",
"-v", "$HOME/.kube:/root/.kube-localhost"]
```

3. Update `.bashrc` to automatically copy the local machine's Kubernetes config into the container and swap out localhost for host.docker.internal whenever a new shell starts. From `dev-container.dockerfile`:
3. Finally, update `.bashrc` to automatically swap out localhost for host.docker.internal in a containr copy of the Kubernetes config. From `dev-container.dockerfile`:

```Dockerfile
RUN echo 'if [ "$SYNC_LOCALHOST_KUBECONFIG" == "true" ]; then \
Expand Down

0 comments on commit c8f0410

Please sign in to comment.