Sublime Text 中 Dockerfile 的语法突出显示?

Syntax highlighting for Dockerfile in Sublime Text?

是否可以在 Sublime Text 中为 Dockerfile 获取语法高亮显示?

当然可以,通过从 Package Control:

安装这个包

为 mac

Press cmd(⌘)-shift-p and type "add repo".
Then paste in the GitHub address for this package:

https://github.com/jaytaylor/Dockerfile.sublime-syntax

Press cmd(⌘)-shift-p and type "install".
Enter "Dockerfile.sublime-syntax" and press enter.

为 windows

the same just replace cmd(⌘) with Ctrl
Now you're all set! Enjoy!

如果有人有同样的问题,在 docker-compose 文件中,您可以将 lower_case_table_names 配置附加到 mysql 命令。

mysql:
    image: mysql:8
    container_name: shiftmonitor_mysql
    command: mysqld --lower_case_table_names=0

而且有效。

4 步

  1. 命令 + shift + p to open 'Command Palette'.

  2. 搜索:包控制:安装包(如果没有,可能需要先安装还)

  3. 然后搜索:dockerfile语法高亮

  4. 关闭并re-open你的 Dockferfile,语法会高亮。