code: function parseHealthcheck(cmd) {
      var words = parseWords(cmd.rest),
          cmdDirectiveIndex = words.indexOf("CMD"),        
          noneDirectiveIndex = words.indexOf("NONE");
  
      if (cmdDirectiveIndex === -1 && noneDirectiveIndex === -1) {
          cmd.error = 'A HEALTHCHECK instruction must specify either NONE, or a valid CMD and options';
          return false;
      } else if (cmdDirectiveIndex !== -1) {
          // Reject a CMD directive that doesn't preceed an actual command.
          if (cmdDirectiveIndex === words.length - 1) {
              cmd.error = 'A CMD directive must specify a command for the healthcheck to run';
              return false;
          }
          
          cmd.args = { command: words.slice(cmdDirectiveIndex + 1).join(" ") };
  
          if (cmdDirectiveIndex > 0) {
              // There are options specified, so let's verify they're valid.
              var cmdDirectiveOptions = words.slice(0, cmdDirectiveIndex),
                  validCmdOptions = ["interval", "retries", "timeout", "start-period"];
  
              for (var i = 0; i < cmdDirectiveOptions.length; i++) {
                  var match = /--([a-zA-Z0-9_-]+)=(\d+)/.exec(cmdDirectiveOptions[i]);
                  if (!match) {
                      cmd.error = '"' + cmdDirectiveOptions[i] + '" isn\'t a syntactically valid CMD option';
                      return false;
                  } else if (validCmdOptions.indexOf(match[1]) === -1) {
                      cmd.error = '"' + match[1] + '" isn\'t a valid CMD option';
                      return false;
                  }
  
                  cmd.args[match[1]] = match[2];
              }
          }
      } else if (noneDirectiveIndex !== -1) {
          if (words.length > 1) {
              cmd.error = 'The NONE directive doesn\'t support additional options';
              return false;
          }
  
          cmd.args = { isNone: true };
      }
  
      return true;
  }
docs: Parse the HEALTHCHECK command. https://docs.docker.com/engine/reference/builder/#/healthcheck