Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ Customize the Docker container run process by adding properties under the `docke
| `extraHosts` | Hosts to be added to the container's `hosts` file for DNS resolution. | None |
| `labels` | The set of labels added to the container. | `com.microsoft.created-by` = `visual-studio-code` |
| `network` | The network to which the container will be connected. Use values as described in the [Docker run documentation](https://docs.docker.com/engine/reference/run/#network-settings). | `bridge` |
| `networkAlias` | The network-scoped alias to assign to the container. | None |
| `ports` | Ports that are going to be mapped on the host. | All ports exposed by the Dockerfile will be bound to a random port on the host machine |
| `volumes` | Volumes that are going to be mapped to the container. | None |

Expand Down Expand Up @@ -271,6 +272,7 @@ Example run customization:
"label2": "value2"
},
"network": "host",
"networkAlias": "mycontainer",
"ports": [
{
"hostPort": 80,
Expand Down
2 changes: 2 additions & 0 deletions debugging/coreclr/dockerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export type DockerRunContainerOptions = {
extraHosts?: DockerContainerExtraHost[];
labels?: { [key: string]: string };
network?: string;
networkAlias?: string;
ports?: DockerContainerPort[];
volumes?: DockerContainerVolume[];
};
Expand Down Expand Up @@ -211,6 +212,7 @@ export class CliDockerClient implements DockerClient {
.withFlagArg('-P', options.ports === undefined || options.ports.length < 1)
.withNamedArg('--name', options.containerName)
.withNamedArg('--network', options.network)
.withNamedArg('--network-alias', options.networkAlias)
.withKeyValueArgs('-e', options.env)
.withArrayArgs('--env-file', options.envFiles)
.withKeyValueArgs('--label', options.labels)
Expand Down
3 changes: 3 additions & 0 deletions debugging/coreclr/dockerDebugConfigurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface DockerDebugRunOptions {
extraHosts?: DockerContainerExtraHost[];
labels?: { [key: string]: string };
network?: string;
networkAlias?: string;
os?: PlatformOS;
ports?: DockerContainerPort[];
volumes?: DockerContainerVolume[];
Expand Down Expand Up @@ -176,6 +177,7 @@ export class DockerDebugConfigurationProvider implements DebugConfigurationProvi
|| DockerDebugConfigurationProvider.defaultLabels;

const network = debugConfiguration && debugConfiguration.dockerRun && debugConfiguration.dockerRun.network;
const networkAlias = debugConfiguration && debugConfiguration.dockerRun && debugConfiguration.dockerRun.networkAlias;
const ports = debugConfiguration && debugConfiguration.dockerRun && debugConfiguration.dockerRun.ports;
const volumes = DockerDebugConfigurationProvider.inferVolumes(folder, debugConfiguration);
const extraHosts = debugConfiguration && debugConfiguration.dockerRun && debugConfiguration.dockerRun.extraHosts;
Expand All @@ -187,6 +189,7 @@ export class DockerDebugConfigurationProvider implements DebugConfigurationProvi
extraHosts,
labels,
network,
networkAlias,
os,
ports,
volumes
Expand Down
1 change: 1 addition & 0 deletions debugging/coreclr/dockerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export class DefaultDockerManager implements DockerManager {
extraHosts: options.extraHosts,
labels: options.labels,
network: options.network,
networkAlias: options.networkAlias,
ports: options.ports,
volumes: [...(volumes || []), ...(options.volumes || [])]
});
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,10 @@
"type": "string",
"description": "The network to which the container will be connected."
},
"networkAlias": {
"type": "string",
"description": "The network-scoped alias to assign to the container."
},
"ports": {
"type": "array",
"description": "Ports that are going to be mapped on the host.",
Expand Down