dockerfile.js 909 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. Language: Dockerfile
  3. Requires: bash.js
  4. Author: Alexis Hénaut <alexis@henaut.net>
  5. Description: language definition for Dockerfile files
  6. Website: https://docs.docker.com/engine/reference/builder/
  7. Category: config
  8. */
  9. /** @type LanguageFn */
  10. function dockerfile(hljs) {
  11. const KEYWORDS = [
  12. "from",
  13. "maintainer",
  14. "expose",
  15. "env",
  16. "arg",
  17. "user",
  18. "onbuild",
  19. "stopsignal"
  20. ];
  21. return {
  22. name: 'Dockerfile',
  23. aliases: [ 'docker' ],
  24. case_insensitive: true,
  25. keywords: KEYWORDS,
  26. contains: [
  27. hljs.HASH_COMMENT_MODE,
  28. hljs.APOS_STRING_MODE,
  29. hljs.QUOTE_STRING_MODE,
  30. hljs.NUMBER_MODE,
  31. {
  32. beginKeywords: 'run cmd entrypoint volume add copy workdir label healthcheck shell',
  33. starts: {
  34. end: /[^\\]$/,
  35. subLanguage: 'bash'
  36. }
  37. }
  38. ],
  39. illegal: '</'
  40. };
  41. }
  42. export { dockerfile as default };