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

Commit d8dc0cb

Browse files
committed
Update READMEs
1 parent 25b9673 commit d8dc0cb

File tree

2 files changed

+25
-28
lines changed

2 files changed

+25
-28
lines changed

containers/docker-in-docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ You can adapt your own existing development container Dockerfile to support this
3939
&& chmod +x /usr/local/bin/docker-compose
4040
```
4141

42-
2. Then just forward the Docker socket by mounting it in the container using `runArgs`. From `.devcontainer/devcontainer.json`:
42+
2. Then just forward the Docker socket by mounting it in the container using the `mounts` property. From `.devcontainer/devcontainer.json`:
4343

4444
```json
45-
"runArgs": ["-v","/var/run/docker.sock:/var/run/docker.sock"]
45+
"mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ]
4646
```
4747

4848
3. Press <kbd>F1</kbd> and run **Remote-Containers: Rebuild Container** so the changes take effect.

containers/kubernetes-helm/README.md

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,31 @@ You can adapt your own existing development container Dockerfile to support this
2525
1. First, update your `devcontainer.json` to forward the local Docker socket and mount the local `.kube` folder in the container so its contents can be reused. From `.devcontainer/devcontainer.json`:
2626

2727
```json
28-
"runArgs": ["-e", "SYNC_LOCALHOST_KUBECONFIG=true",
29-
"-v", "/var/run/docker.sock:/var/run/docker.sock",
30-
"-v", "$HOME/.kube:/root/.kube-localhost"]
28+
"mounts": [
29+
"source=/var/run/docker.sock,target=/var/run/docker.sock",
30+
"source=${env:HOME}${env:USERPROFILE}/.kube,target=/root/.kube-localhost,type=bind"
31+
],
32+
"remoteEnv": {
33+
"SYNC_LOCALHOST_KUBECONFIG": "true"
34+
}
3135
```
3236

3337
If you also want to reuse your Minikube certificates, just add a mount for your local `.minikube` folder as well:
3438

3539
```json
36-
"runArgs": ["-e", "SYNC_LOCALHOST_KUBECONFIG=true",
37-
"-v", "/var/run/docker.sock:/var/run/docker.sock",
38-
"-v", "$HOME/.kube:/root/.kube-localhost",
39-
"-v", "$HOME/.minikube:/root/.minikube-localhost"]
40+
"mounts": [
41+
"source=/var/run/docker.sock,target=/var/run/docker.sock",
42+
"source=${env:HOME}${env:USERPROFILE}/.kube,target=/root/.kube-localhost,type=bind",
43+
"source=${env:HOME}${env:USERPROFILE}/.minikube,target=/root/.minikube-localhost,type=bind"
44+
],
45+
"remoteEnv": {
46+
"SYNC_LOCALHOST_KUBECONFIG": "true"
47+
}
4048
```
4149

42-
2. Second, update `devcontainer.json` to force the Docker extension to be installed inside the container instead of locally. From `.devcontainer/devcontainer.json`:
43-
44-
```json
45-
"settings": {
46-
"remote.extensionKind": {
47-
"ms-azuretools.vscode-docker": "workspace"
48-
}
49-
},
50-
```
51-
52-
3. Next, update your Dockerfile so the default shell is `bash`, and then add a script to automatically swap out `localhost` for `host.docker.internal` in the container's copy of the Kubernetes config and (optionally) Minikube certificates to `.bashrc`. From `.devcontainer/Dockerfile`:
50+
2. Next, update your Dockerfile so the default shell is `bash`, and then add a script to automatically swap out `localhost` for `host.docker.internal` in the container's copy of the Kubernetes config and (optionally) Minikube certificates to `.bashrc`. From `.devcontainer/Dockerfile`:
5351

5452
```Dockerfile
55-
ENV SHELL /bin/bash
56-
5753
RUN echo '\n\
5854
if [ "$SYNC_LOCALHOST_KUBECONFIG" == "true" ]; then\n\
5955
mkdir -p $HOME/.kube\n\
@@ -73,7 +69,7 @@ You can adapt your own existing development container Dockerfile to support this
7369
>> $HOME/.bashrc
7470
```
7571

76-
4. Finally, update your Dockerfile to install all of the needed CLIs in the container. From `.devcontainer/Dockerfile`:
72+
3. Finally, update your Dockerfile to install all of the needed CLIs in the container. From `.devcontainer/Dockerfile`:
7773

7874
```Dockerfile
7975
RUN apt-get update \
@@ -93,7 +89,7 @@ You can adapt your own existing development container Dockerfile to support this
9389
curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash -
9490
```
9591

96-
5. Press <kbd>F1</kbd> and run **Remote-Containers: Rebuild Container** so the changes take effect.
92+
4. Press <kbd>F1</kbd> and run **Remote-Containers: Rebuild Container** so the changes take effect.
9793

9894
That's it!
9995

@@ -107,13 +103,13 @@ A few notes on the definition:
107103
FROM node:lts
108104
```
109105

110-
* If you also want to sync your Minikube certificates, open `.devcontainer/devcontainer.json` and uncomment this line in `runArgs`:
106+
* If you also want to sync your Minikube certificates, open `.devcontainer/devcontainer.json` and uncomment this line in the `mount` property :
111107

112108
```json
113-
"--mount", "type=bind,source=${env:HOME}${env:USERPROFILE}/.minikube,target=/root/.minikube-localhost",
109+
"source=${env:HOME}${env:USERPROFILE}/.minikube,target=/root/.minikube-localhost,type=bind",
114110
```
115-
116-
* If you want to **disable sync'ing** local Kubernetes config / Minikube certs into the container, remove `"-e", "SYNC_LOCALHOST_KUBECONFIG=true",` from `runArgs` in `.devcontainer/devcontainer.json`.
111+
112+
* If you want to **disable sync'ing** local Kubernetes config / Minikube certs into the container, remove `"SYNC_LOCALHOST_KUBECONFIG": "true",` from `remoteEnv` in `.devcontainer/devcontainer.json`.
117113

118114
See the section below for your operating system for more detailed setup instructions.
119115

@@ -140,6 +136,7 @@ See the section below for your operating system for more detailed setup instruct
140136
7. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.
141137

142138
8. [Optional] If you want to use [Helm](https://helm.sh), open a VS Code terminal and run:
139+
143140
```
144141
helm init
145142
```

0 commit comments

Comments
 (0)