Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mark certain files as docker is Vscode? [duplicate]

The aim is to get docker syntax support in vscode. In order to achieve this, the docker plugin was installed, but it turns out that only Dockerfile and docker-compose are seen as docker files, but the the repository contains .docker files. Would it be possible to mark .docker files as dockerfiles in vcsode?

Example

In this example the someimage.docker should be marked as docker so that a docker icon would appear like the icon that is put in front of the Dockerfile. When the file is opened, there should be docker syntax support.

enter image description here

Attempt to solve the issue

The first attempt to solve the issue was consulting the settings, but it does not seem to be possible to associated certain extensions with the docker format.

like image 239
030 Avatar asked Oct 01 '18 10:10

030


People also ask

How do you change all occurrences of a word in VS Code?

First put your cursor on the member and click F2. Then type the new name and hit the Enter key. This will rename all of the occurrences in every file in your project.

What is workspaceFolder in VS Code?

${workspaceFolder} - the path of the folder opened in VS Code. ${workspaceFolderBasename} - the name of the folder opened in VS Code without any slashes (/)


1 Answers

Basically set the files.associations setting in the settings.json file.

{
  "files.associations": {
        "*.docker": "dockerfile"
    }
}

You can use the "dockerfile" language identifier.

like image 175
Ropstah Avatar answered Oct 01 '22 13:10

Ropstah