Skip to content

Commit 080e467

Browse files
Add support for Containerfile and .containerignore alongside Dockerfile (#238)
* Initial plan * Add Containerfile and .containerignore support Co-authored-by: bwateratmsft <[email protected]> * Address PR feedback: use resourceLangId and revert scaffolding changes Co-authored-by: bwateratmsft <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: bwateratmsft <[email protected]>
1 parent 4953428 commit 080e467

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
],
192192
"explorer/context": [
193193
{
194-
"when": "isWorkspaceTrusted && resourceFilename =~ /dockerfile/i",
194+
"when": "isWorkspaceTrusted && resourceLangId == dockerfile",
195195
"command": "vscode-containers.registries.azure.buildImage",
196196
"group": "containers"
197197
},
@@ -1553,16 +1553,21 @@
15531553
"filenamePatterns": [
15541554
"*.dockerfile",
15551555
"Dockerfile",
1556-
"Dockerfile.*"
1556+
"Dockerfile.*",
1557+
"*.containerfile",
1558+
"Containerfile",
1559+
"Containerfile.*"
15571560
]
15581561
},
15591562
{
15601563
"id": "ignore",
15611564
"filenames": [
1562-
".dockerignore"
1565+
".dockerignore",
1566+
".containerignore"
15631567
],
15641568
"filenamePatterns": [
1565-
"*.dockerignore"
1569+
"*.dockerignore",
1570+
"*.containerignore"
15661571
]
15671572
}
15681573
],
@@ -2942,6 +2947,7 @@
29422947
"title": "%vscode-containers.walkthrough.containersStart.title%",
29432948
"featuredFor": [
29442949
"Dockerfile",
2950+
"Containerfile",
29452951
"compose.yaml",
29462952
"docker-compose.yml",
29472953
"docker-compose.yaml",

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const imageTagRegExp = new RegExp('^[a-zA-Z0-9.-_/]{1,256}:(?![.-])[a-zA-
2020
// GLOB Patterns
2121
export const FROM_DIRECTIVE_PATTERN = /^\s*FROM\s*([\w-/:]*)(\s*AS\s*[a-z][a-z0-9-_\\.]*)?$/i;
2222
export const COMPOSE_FILE_GLOB_PATTERN = '**/*[cC][oO][mM][pP][oO][sS][eE]*.{[yY][aA][mM][lL],[yY][mM][lL]}';
23-
export const DOCKERFILE_GLOB_PATTERN = '**/{*.[dD][oO][cC][kK][eE][rR][fF][iI][lL][eE],[dD][oO][cC][kK][eE][rR][fF][iI][lL][eE],[dD][oO][cC][kK][eE][rR][fF][iI][lL][eE].*}';
23+
export const DOCKERFILE_GLOB_PATTERN = '**/{*.[dD][oO][cC][kK][eE][rR][fF][iI][lL][eE],[dD][oO][cC][kK][eE][rR][fF][iI][lL][eE],[dD][oO][cC][kK][eE][rR][fF][iI][lL][eE].*,*.[cC][oO][nN][tT][aA][iI][nN][eE][rR][fF][iI][lL][eE],[cC][oO][nN][tT][aA][iI][nN][eE][rR][fF][iI][lL][eE],[cC][oO][nN][tT][aA][iI][nN][eE][rR][fF][iI][lL][eE].*}';
2424
export const YAML_GLOB_PATTERN = '**/*.{[yY][aA][mM][lL],[yY][mM][lL]}';
2525
export const CSPROJ_GLOB_PATTERN = '**/*.{[cC][sS][pP][rR][oO][jJ]}';
2626
export const FSPROJ_GLOB_PATTERN = '**/*.{[fF][sS][pP][rR][oO][jJ]}';

0 commit comments

Comments
 (0)