public DockerFileBuilder basedir(String dir) {
        if (dir != null) {
            if (!dir.startsWith("/") && !ENV_VAR_PATTERN.matcher(dir).matches()) {
                throw new IllegalArgumentException("'basedir' must be an absolute path starting with / (and not " +
                                                   "'" + basedir + "') or start with an environment variable");
            }
            basedir = dir;
        }
        return this;
    }
Escape any slashes, quotes, and newlines int the value.  If any escaping occurred, quote the value.
@param key The key
@param value The value
@return Escaped and quoted key="value"
src/main/java/io/fabric8/maven/docker/assembly/DockerFileBuilder.java