Skip to content

Commit 43f4cf2

Browse files
committed
docker compose linux issue fixed and default values changed
1 parent 58f39ae commit 43f4cf2

File tree

8 files changed

+40
-28
lines changed

8 files changed

+40
-28
lines changed

Tasks/Docker/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"loc.friendlyName": "Docker",
3-
"loc.helpMarkDown": "[More Information](http://aka.ms/dockertoolsforvsts)",
4-
"loc.description": "Build, push or run Docker images, or run a Docker command",
3+
"loc.helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=848006)",
4+
"loc.description": "Build, push or run Docker images, or run a Docker command. Task can be used with Docker or Azure Container registry.",
55
"loc.instanceNameFormat": "$(action)",
66
"loc.group.displayName.advanced": "Advanced Options",
77
"loc.input.label.containerregistrytype": "Container Registry Type",
@@ -23,7 +23,7 @@
2323
"loc.input.label.context": "Build Context",
2424
"loc.input.help.context": "Path to the build context.",
2525
"loc.input.label.imageName": "Image Name",
26-
"loc.input.help.imageName": "Name of the Docker image to build, push or run.",
26+
"loc.input.help.imageName": "Name of the Docker image to build, push or run. The name will be converted to lowercase as Docker supports only lowercase for image names.",
2727
"loc.input.label.qualifyImageName": "Qualify Image Name",
2828
"loc.input.help.qualifyImageName": "Qualify the image name with the Docker registry connection's hostname if not otherwise specified.",
2929
"loc.input.label.additionalImageTags": "Additional Image Tags",

Tasks/Docker/containerbuild.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ function findDockerFile(dockerfilepath : string) : string {
2727
}
2828
}
2929

30+
function changeImageNameToLowerCase(imageName: string): string {
31+
var imageNameArray = imageName.split(":");
32+
33+
if(imageNameArray.length > 0)
34+
{
35+
imageName = imageNameArray[0].toLowerCase() + ":" + imageNameArray.slice(1).join(":");
36+
}
37+
38+
return imageName;
39+
}
40+
3041
export function run(connection: ContainerConnection): any {
3142
var command = connection.createCommand();
3243
command.arg("build");
@@ -45,6 +56,7 @@ export function run(connection: ContainerConnection): any {
4556
});
4657

4758
var imageName = tl.getInput("imageName", true);
59+
imageName = changeImageNameToLowerCase(imageName);
4860
var qualifyImageName = tl.getBoolInput("qualifyImageName");
4961
if (qualifyImageName) {
5062
imageName = connection.qualifyImageName(imageName);

Tasks/Docker/task.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "E28912F1-0114-4464-802A-A3A35437FD16",
33
"name": "Docker",
44
"friendlyName": "Docker",
5-
"description": "Build, push or run Docker images, or run a Docker command",
5+
"description": "Build, push or run Docker images, or run a Docker command. Task can be used with Docker or Azure Container registry.",
66
"helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=848006)",
77
"category": "Build",
88
"visibility": [
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 0,
1515
"Minor": 2,
16-
"Patch": 3
16+
"Patch": 4
1717
},
1818
"demands": [],
1919
"preview": "true",
@@ -97,7 +97,7 @@
9797
"name": "defaultContext",
9898
"type": "boolean",
9999
"label": "Use Default Build Context",
100-
"defaultValue": "false",
100+
"defaultValue": "true",
101101
"visibleRule": "action = Build an image",
102102
"helpMarkDown": "Set the build context to the directory that contains the Docker file."
103103
},
@@ -115,13 +115,13 @@
115115
"defaultValue": "$(Build.Repository.Name):$(Build.BuildId)",
116116
"required": true,
117117
"visibleRule": "action = Build an image || action = Push an image || action = Run an image",
118-
"helpMarkDown": "Name of the Docker image to build, push or run."
118+
"helpMarkDown": "Name of the Docker image to build, push or run. The name will be converted to lowercase as Docker supports only lowercase for image names."
119119
},
120120
{
121121
"name": "qualifyImageName",
122122
"type": "boolean",
123123
"label": "Qualify Image Name",
124-
"defaultValue": "false",
124+
"defaultValue": "true",
125125
"visibleRule": "action = Build an image || action = Push an image || action = Run an image",
126126
"helpMarkDown": "Qualify the image name with the Docker registry connection's hostname if not otherwise specified."
127127
},

Tasks/Docker/task.loc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 0,
1515
"Minor": 2,
16-
"Patch": 3
16+
"Patch": 4
1717
},
1818
"demands": [],
1919
"preview": "true",
@@ -97,7 +97,7 @@
9797
"name": "defaultContext",
9898
"type": "boolean",
9999
"label": "ms-resource:loc.input.label.defaultContext",
100-
"defaultValue": "false",
100+
"defaultValue": "true",
101101
"visibleRule": "action = Build an image",
102102
"helpMarkDown": "ms-resource:loc.input.help.defaultContext"
103103
},
@@ -121,7 +121,7 @@
121121
"name": "qualifyImageName",
122122
"type": "boolean",
123123
"label": "ms-resource:loc.input.label.qualifyImageName",
124-
"defaultValue": "false",
124+
"defaultValue": "true",
125125
"visibleRule": "action = Build an image || action = Push an image || action = Run an image",
126126
"helpMarkDown": "ms-resource:loc.input.help.qualifyImageName"
127127
},

Tasks/DockerCompose/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"loc.friendlyName": "Docker Compose",
3-
"loc.helpMarkDown": "[More Information](http://aka.ms/dockertoolsforvsts)",
4-
"loc.description": "Build, push or run multi-container Docker applications",
3+
"loc.helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=848006)",
4+
"loc.description": "Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.",
55
"loc.instanceNameFormat": "$(action)",
66
"loc.group.displayName.advanced": "Advanced Options",
77
"loc.input.label.containerregistrytype": "Container Registry Type",

Tasks/DockerCompose/dockercompose.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ if (nopIfNoDockerComposeFile && !tl.exist(dockerFile)) {
4444
var action = tl.getInput("action", true);
4545
/* tslint:disable:no-var-requires */
4646
return require({
47-
"Build services": "./dockerComposeBuild",
48-
"Push services": "./dockerComposePush",
49-
"Run services": "./dockerComposeUp",
50-
"Run a specific service": "./dockerComposeRun",
51-
"Lock services": "./dockerComposeLock",
52-
"Write service image digests": "./dockerComposeDigests",
53-
"Combine configuration": "./dockerComposeConfig",
54-
"Run a Docker Compose command": "./dockerComposeCommand"
47+
"Build services": "./dockercomposebuild",
48+
"Push services": "./dockercomposepush",
49+
"Run services": "./dockercomposeup",
50+
"Run a specific service": "./dockercomposerun",
51+
"Lock services": "./dockercomposelock",
52+
"Write service image digests": "./dockercomposedigests",
53+
"Combine configuration": "./dockercomposeconfig",
54+
"Run a Docker Compose command": "./dockercomposecommand"
5555
}[action]).run(connection);
5656
/* tslint:enable:no-var-requires */
5757
})

Tasks/DockerCompose/task.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "6975E2D1-96D3-4AFC-8A41-498B5D34EA19",
33
"name": "DockerCompose",
44
"friendlyName": "Docker Compose",
5-
"description": "Build, push or run multi-container Docker applications",
5+
"description": "Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.",
66
"helpMarkDown": "[More Information](https://go.microsoft.com/fwlink/?linkid=848006)",
77
"category": "Build",
88
"visibility": [
@@ -12,8 +12,8 @@
1212
"author": "Microsoft Corporation",
1313
"version": {
1414
"Major": 0,
15-
"Minor": 3,
16-
"Patch": 7
15+
"Minor": 4,
16+
"Patch": 0
1717
},
1818
"demands": [],
1919
"preview": "true",
@@ -98,7 +98,7 @@
9898
"name": "qualifyImageNames",
9999
"type": "boolean",
100100
"label": "Qualify Image Names",
101-
"defaultValue": "false",
101+
"defaultValue": "true",
102102
"helpMarkDown": "Qualify image names for built services with the Docker registry connection's hostname if not otherwise specified."
103103
},
104104
{

Tasks/DockerCompose/task.loc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"author": "Microsoft Corporation",
1313
"version": {
1414
"Major": 0,
15-
"Minor": 3,
16-
"Patch": 7
15+
"Minor": 4,
16+
"Patch": 0
1717
},
1818
"demands": [],
1919
"preview": "true",
@@ -98,7 +98,7 @@
9898
"name": "qualifyImageNames",
9999
"type": "boolean",
100100
"label": "ms-resource:loc.input.label.qualifyImageNames",
101-
"defaultValue": "false",
101+
"defaultValue": "true",
102102
"helpMarkDown": "ms-resource:loc.input.help.qualifyImageNames"
103103
},
104104
{

0 commit comments

Comments
 (0)