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

Commit

Permalink
Move settings into devcontainer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed May 23, 2019
1 parent dfd5be0 commit dbf3ff8
Show file tree
Hide file tree
Showing 87 changed files with 243 additions and 222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
// connected. This is typically a volume mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/workspace",

// Add any extensions you want auto-installed here.
"extensions": [],

// Update the value of this line to 'none' if you want to keep your containers running after VS Code shuts down.
"shutdownAction": "stopCompose",

// Uncomment the next line to automatically install extensions.
// "extensions": [ "eamodio.gitlens" ],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": ["uname -a"]

}
18 changes: 11 additions & 7 deletions container-templates/dockerfile/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "Dockerfile",

// Use the optional 'appPort' property to publish any ports you want to access.
"appPort": [],

// Add any extensions you want auto-installed here.
"extensions": [],

// The optional 'runArgs' property can be used to specify additional runtime arguments.
"runArgs": [
// Uncomment the next line if you want to use Docker from the container. See the docker-in-docker definition for details.
Expand All @@ -21,6 +15,16 @@
// "--security-opt", "seccomp=unconfined"
],

// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line to automatically install extensions.
// "extensions": [ "eamodio.gitlens" ],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": ["uname -a"]
// "postCreateCommand": "uname -a",

}
18 changes: 11 additions & 7 deletions container-templates/image/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
// Update the 'image' property with your Docker image name.
"image": "ubuntu:bionic",

// Use the optional 'appPort' property to publish any ports you want to access.
"appPort": [],

// Add any extensions you want auto-installed here.
"extensions": [],

// The optional 'runArgs' property can be used to specify additional runtime arguments.
"runArgs": [
// Uncomment the next line if you want to use Docker from the container. See the docker-in-docker definition for details.
Expand All @@ -21,6 +15,16 @@
// "--security-opt", "seccomp=unconfined"
],

// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line to automatically install extensions.
// "extensions": [ "eamodio.gitlens" ],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": ["uname -a"]
// "postCreateCommand": "uname -a",

}
8 changes: 6 additions & 2 deletions containers/azure-ansible/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
"ms-vscode.azurecli"
],
"runArgs": [
"-v",
"/var/run/docker.sock:/var/run/docker.sock"
"-v", "/var/run/docker.sock:/var/run/docker.sock"
],

// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "ansible --version"
}
3 changes: 3 additions & 0 deletions containers/azure-cli/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "az --version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"ms-vscode.csharp"
],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "dotnet restore"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"ms-vscode.csharp"
],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "dotnet restore"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"vscjava.vscode-java-pack"
],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "java -version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"dbaeumer.vscode-eslint"
],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "npm install"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"dbaeumer.vscode-eslint"
],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "npm install"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1

# Copy default endpoint specific user settings overrides into container to
# to specify Python path and that Docker should run as a workspace extension
COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json

# Install git, required tools
RUN apt-get install -y \
git \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
"ms-toolsai.vscode-ai",
"peterjausovec.vscode-docker"
],
"runArgs": ["-v","/var/run/docker.sock:/var/run/docker.sock"],
"settings": {
"remote.extensionKind": {
"peterjausovec.vscode-docker": "workspace"
},
"python.pythonPath": "/opt/conda/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
},
"runArgs": [
"-v","/var/run/docker.sock:/var/run/docker.sock"
],

// Uncomment the next line if you want to publish any ports.
// "appPort": [],
Expand Down

This file was deleted.

7 changes: 6 additions & 1 deletion containers/azure-terraform/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@
"ms-vscode.azurecli",
"peterjausovec.vscode-docker"
],
"runArgs": ["-v","/var/run/docker.sock:/var/run/docker.sock"],
"runArgs": [
"-v","/var/run/docker.sock:/var/run/docker.sock"
],

// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "terraform --version"
}
8 changes: 6 additions & 2 deletions containers/bazel/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"name": "Bazel",
"dockerFile": "Dockerfile",

"extensions": ["devondcarew.bazel-code"],
"extensions": [
"devondcarew.bazel-code"
],

// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "uname -a",

Expand Down
3 changes: 3 additions & 0 deletions containers/cpp/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "gcc -v"
}
5 changes: 4 additions & 1 deletion containers/dart/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": ""
// "postCreateCommand": "uname -a"
}
9 changes: 6 additions & 3 deletions containers/debian-9-git/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
"name": "Debian 9 & Git",
"dockerFile": "Dockerfile",

// Uncomment the next line to automatically install extensions.
// "extensions": [],

// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line to automatically install extensions.
// "extensions": [ "eamodio.gitlens" ],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "uname -a",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
"shutdownAction": "stopCompose",

// Uncomment the next line to automatically install extensions.
// "extensions": [],
// "extensions": [ "eamodio.gitlens" ],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "uname -a"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,25 @@
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "Dockerfile",

// Uncomment the next line to automatically install extensions.
// "extensions": [],

// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "uname -a",

// The optional 'runArgs' property can be used to specify additional runtime arguments.
"runArgs": [
// Uncomment the next line if you want to use Docker from the container. See the docker-in-docker definition for details.
// "-v","/var/run/docker.sock:/var/run/docker.sock",

// Uncomment the next line if you will be using a ptrace-based debugger like C++, Go, and Rust.
// "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"
]
],

// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line to automatically install extensions.
// "extensions": [ "eamodio.gitlens" ],

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "uname -a",

}
3 changes: 0 additions & 3 deletions containers/docker-in-docker-compose/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
# Note: You can use any Debian/Ubuntu based image you want.
FROM debian:9

# Copy settings file so Docker extension is installed inside the container
COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json

# Configure apt
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"extensions": [
"peterjausovec.vscode-docker"
],
"settings": {
"remote.extensionKind": {
"peterjausovec.vscode-docker": "workspace"
}
},

// Update the value of this line to 'none' if you want to keep your containers running after VS Code shuts down.
"shutdownAction": "stopCompose",
Expand Down

This file was deleted.

12 changes: 3 additions & 9 deletions containers/docker-in-docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,14 @@ You can adapt your own existing development container Docker Compose setup to su
- /var/run/docker.sock:/var/run/docker.sock
```

3. Add a container specific user settings file that forces the Docker extension to be installed inside the container instead of locally. From `.devcontainer/Dockerfile`:

```Dockerfile
COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json
```

From `.devcontainer/settings.vscode.json`:
3. Finally, update `devcontainer.json` to force the Docker extension to be installed inside the container instead of locally. From `.devcontainer/devcontainer.json`:

```json
{
"settings": {
"remote.extensionKind": {
"peterjausovec.vscode-docker": "workspace"
}
}
},
```

4. Press <kbd>F1</kbd> and run **Remote-Containers: Rebuild Container** so the changes take effect.
Expand Down
Loading

0 comments on commit dbf3ff8

Please sign in to comment.