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

Commit

Permalink
Add setting to workaround VSCR #1203, add runServices comment to Dock…
Browse files Browse the repository at this point in the history
…er Compose defs
  • Loading branch information
Chuxel committed Aug 26, 2019
1 parent 3dfc88f commit 2e92345
Show file tree
Hide file tree
Showing 57 changed files with 495 additions and 245 deletions.
15 changes: 10 additions & 5 deletions container-templates/docker-compose/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@
// connected. This is typically a volume mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/workspace",

// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],

// Uncomment this like if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",

// 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"

// Add the IDs of any extensions you want installed in the array below.
// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": []

}
14 changes: 8 additions & 6 deletions container-templates/dockerfile/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@
// "-u", "vscode"
],

// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"

This comment has been minimized.

Copy link
@chrmarti

chrmarti Aug 29, 2019

Contributor

@Chuxel This doesn't work with images that don't have bash installed (like Alpine).

This comment has been minimized.

Copy link
@Chuxel

Chuxel Aug 29, 2019

Author Member

Yep - there we'd set it to ash. These are all Debian or Ubuntu based.

This comment has been minimized.

Copy link
@chrmarti

chrmarti Aug 30, 2019

Contributor

Since this is the definition for the existing Dockerfile, should we avoid the assumption that bash is available?

This comment has been minimized.

Copy link
@chrmarti

chrmarti Aug 30, 2019

Contributor

I see the same for the existing docker-compose.yml.

This comment has been minimized.

Copy link
@chrmarti

chrmarti Aug 30, 2019

Contributor

Actually: root's default shell in Debian and Alpine are set to bash and ash, it would be best not to override the default shell. To avoid having the user settings set a shell that does not exist in the container, you can set this setting here to null which will result in the default shell being used (I just learned).

This comment has been minimized.

Copy link
@Chuxel

Chuxel Aug 30, 2019

Author Member

I added a comment saying to change this to ash for Alpine.

Until we get the task thing figured out with alternate shells, we'll need to do something here. We're broken by default on Linux given the popularity of zsh.

This comment has been minimized.

Copy link
@Chuxel

Chuxel Aug 30, 2019

Author Member

Also - this isn't the existing dockerfile one - this is the template for creating a new definition. Are you using this one?

The right one is:
https://github.com/microsoft/vscode-dev-containers/tree/master/containers/docker-existing-dockerfile

and

https://github.com/microsoft/vscode-dev-containers/tree/master/containers/docker-existing-docker-compose

In those cases I agree, we should comment it out.

This comment has been minimized.

Copy link
@chrmarti

chrmarti Aug 30, 2019

Contributor

Ah...I'm looking in the wrong place. :)

For the existing Dockerfile / docker-compose.yml you could set the shell setting to null which will override any user setting (like for zsh) and make the terminal pick the default shell of the container.

For the task issue with existing Dockerfile / docker-compose.yml couldn't we set the more specifc "terminal.integrated.automationShell.linux" to bash to workaround the issue for most containers?

This comment has been minimized.

Copy link
@Chuxel

Chuxel Aug 30, 2019

Author Member

For the existing Dockerfile / docker-compose.yml you could set the shell setting to null

Yeah in this case, the setting is at the OS level, not the user level. (I've run chsh on my Linux machine, Mac and WSL), but combined with a comment that is a good suggestion for the existing definitions.

For the task issue with existing Dockerfile / docker-compose.yml couldn't we set the more specifc "terminal.integrated.automationShell.linux" to bash to workaround the issue for most containers?

We could, but as I thought through the different scenarios, I think that could be even more confusing. For example, if the Linux shell has been overriden in user settings, you could end up with the reverse where the tasks are in bash but the shell is something else. Sticking with the same shell in both cases is a bit more predictable. We could set the shell to null, but if you do install zsh you then end up needing to tweak two settings.

This comment has been minimized.

Copy link
@Chuxel

Chuxel Aug 30, 2019

Author Member

Ok - udpated!

},

// 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",

// Add the IDs of any extensions you want installed in the array below.
// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": []

}
}
11 changes: 7 additions & 4 deletions container-templates/image/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@
// "-u", "vscode"
],

// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// 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 - like installing git
// "postCreateCommand": "apt-get update && apt-get install -y git",

// Add the IDs of any extensions you want installed in the array below.
// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": []
}
20 changes: 11 additions & 9 deletions containers/azure-ansible/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,26 @@
"-v", "/var/run/docker.sock:/var/run/docker.sock"
],

// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"remote.extensionKind": {
"ms-azuretools.vscode-docker": "workspace"
}
},

// 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",

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"vscoss.vscode-ansible",
"redhat.vscode-yaml",
"ms-vscode.azurecli",
"ms-azuretools.vscode-docker"
],
"settings": {
"remote.extensionKind": {
"ms-azuretools.vscode-docker": "workspace"
}
}
]
}
12 changes: 8 additions & 4 deletions containers/azure-blockchain/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
"name": "Azure Blockchain",
"dockerFile": "Dockerfile",

// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// 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",

Expand All @@ -16,6 +19,7 @@
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
// "runArgs": [ "-u", "vscode" ],

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-vscode.azurecli",
"azblockchain.azure-blockchain"
Expand Down
10 changes: 7 additions & 3 deletions containers/azure-cli/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@
// "-u", "vscode"
],

// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// 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",

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-vscode.azurecli"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"dockerFile": "Dockerfile",
"appPort": 7071,

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "dotnet restore",
Expand All @@ -14,6 +17,7 @@
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
// "runArgs": [ "-u", "vscode" ],

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-azuretools.vscode-azurefunctions",
"ms-vscode.csharp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"dockerFile": "Dockerfile",
"appPort": 7071,

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "dotnet restore",
Expand All @@ -14,6 +17,7 @@
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
// "runArgs": [ "-u", "vscode" ],

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-azuretools.vscode-azurefunctions",
"ms-vscode.csharp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
"dockerFile": "Dockerfile",
"appPort": 7071,

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"java.home": "/docker-java-home"
},

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "java -version",
Expand All @@ -14,11 +18,9 @@
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
// "runArgs": [ "-u", "vscode" ],

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-azuretools.vscode-azurefunctions",
"vscjava.vscode-java-pack"
],
"settings": {
"java.home": "/docker-java-home"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"dockerFile": "Dockerfile",
"appPort": 7071,

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "npm install",
Expand All @@ -14,6 +17,7 @@
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
// "runArgs": [ "-u", "node" ],

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-azuretools.vscode-azurefunctions",
"dbaeumer.vscode-eslint"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"dockerFile": "Dockerfile",
"appPort": 7071,

// Uncomment the next line if you want to add in default container specific settings.json values
// "settings": { "workbench.colorTheme": "Quiet Light" },
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "npm install",
Expand All @@ -14,6 +17,7 @@
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
// "runArgs": [ "-u", "node" ],

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-azuretools.vscode-azurefunctions",
"dbaeumer.vscode-eslint"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,22 @@
"-v","/var/run/docker.sock:/var/run/docker.sock"
],

// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"remote.extensionKind": {
"ms-azuretools.vscode-docker": "workspace"
}
},

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "npm install",

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-azuretools.vscode-azurefunctions",
"ms-azuretools.vscode-docker",
"ms-python.python"
],
"settings": {
"remote.extensionKind": {
"ms-azuretools.vscode-docker": "workspace"
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,28 @@
"-v", "/var/run/docker.sock:/var/run/docker.sock"
],


// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"remote.extensionKind": {
"ms-azuretools.vscode-docker": "workspace"
},
"python.pythonPath": "/opt/conda/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
},

// 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": "pip install -r requirements.txt",

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-toolsai.vscode-ai",
"ms-azuretools.vscode-docker"
],
"settings": {
"remote.extensionKind": {
"ms-azuretools.vscode-docker": "workspace"
},
"python.pythonPath": "/opt/conda/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
}
]
}
20 changes: 11 additions & 9 deletions containers/azure-terraform/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,26 @@
"-v", "/var/run/docker.sock:/var/run/docker.sock"
],

// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"remote.extensionKind": {
"ms-azuretools.vscode-docker": "workspace"
}
},

// 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",

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"mauve.terraform",
"ms-azuretools.vscode-azureterraform",
"ms-vscode.azurecli",
"ms-azuretools.vscode-docker"
],
"settings": {
"remote.extensionKind": {
"ms-azuretools.vscode-docker": "workspace"
}
}
]
}
Loading

0 comments on commit 2e92345

Please sign in to comment.