Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Associate Dockerfile language with all Dockerfiles in VS Code

What I want to do is tell Visual Studio Code to associate all files containing the word "Dockerfile" in their filename with the Dockerfile language to get the syntax highlighting. According to this site the language is just called "Dockerfile", so I added the following entry to settings.json:

"files.associations": {
    "*Dockerfile*": "Dockerfile"
}

But all that happened was that now even the standard Dockerfiles are no longer associated with their respective language. What am I doing wrong?

like image 917
TigersEye120 Avatar asked Oct 18 '25 09:10

TigersEye120


1 Answers

The language identifier for Dockerfile is a lower-case dockerfile as stated on https://code.visualstudio.com/docs/languages/identifiers. Hence, you need to adjust your snippet as follows:

"files.associations": {
    "*Dockerfile*": "dockerfile"
}
like image 158
jboockmann Avatar answered Oct 20 '25 16:10

jboockmann