Signed-off-by: Hu Keping <hukeping@huawei.com>
| ... | ... |
@@ -14,6 +14,8 @@ import ( |
| 14 | 14 |
"github.com/docker/docker/pkg/urlutil" |
| 15 | 15 |
) |
| 16 | 16 |
|
| 17 |
+// GitClone clones a repository into a newly created directory which |
|
| 18 |
+// will be under "docker-build-git" |
|
| 17 | 19 |
func GitClone(remoteURL string) (string, error) {
|
| 18 | 20 |
if !urlutil.IsGitTransport(remoteURL) {
|
| 19 | 21 |
remoteURL = "https://" + remoteURL |
| ... | ... |
@@ -19,7 +19,7 @@ import ( |
| 19 | 19 |
"github.com/docker/docker/pkg/stringid" |
| 20 | 20 |
) |
| 21 | 21 |
|
| 22 |
-// Figure out the absolute path of our own binary (if it's still around). |
|
| 22 |
+// SelfPath figures out the absolute path of our own binary (if it's still around). |
|
| 23 | 23 |
func SelfPath() string {
|
| 24 | 24 |
path, err := exec.LookPath(os.Args[0]) |
| 25 | 25 |
if err != nil {
|
| ... | ... |
@@ -79,7 +79,7 @@ func isValidDockerInitPath(target string, selfPath string) bool { // target and
|
| 79 | 79 |
return dockerversion.INITSHA1 != "" && dockerInitSha1(target) == dockerversion.INITSHA1 |
| 80 | 80 |
} |
| 81 | 81 |
|
| 82 |
-// Figure out the path of our dockerinit (which may be SelfPath()) |
|
| 82 |
+// DockerInitPath figures out the path of our dockerinit (which may be SelfPath()) |
|
| 83 | 83 |
func DockerInitPath(localCopy string) string {
|
| 84 | 84 |
selfPath := SelfPath() |
| 85 | 85 |
if isValidDockerInitPath(selfPath, selfPath) {
|
| ... | ... |
@@ -157,7 +157,7 @@ func GetCallerName(depth int) string {
|
| 157 | 157 |
return callerShortName |
| 158 | 158 |
} |
| 159 | 159 |
|
| 160 |
-// ReplaceOrAppendValues returns the defaults with the overrides either |
|
| 160 |
+// ReplaceOrAppendEnvValues returns the defaults with the overrides either |
|
| 161 | 161 |
// replaced by env key or appended to the list |
| 162 | 162 |
func ReplaceOrAppendEnvValues(defaults, overrides []string) []string {
|
| 163 | 163 |
cache := make(map[string]int, len(defaults)) |
| ... | ... |
@@ -239,7 +239,7 @@ func ValidateContextDirectory(srcPath string, excludes []string) error {
|
| 239 | 239 |
}) |
| 240 | 240 |
} |
| 241 | 241 |
|
| 242 |
-// Reads a .dockerignore file and returns the list of file patterns |
|
| 242 |
+// ReadDockerIgnore reads a .dockerignore file and returns the list of file patterns |
|
| 243 | 243 |
// to ignore. Note this will trim whitespace from each line as well |
| 244 | 244 |
// as use GO's "clean" func to get the shortest/cleanest path for each. |
| 245 | 245 |
func ReadDockerIgnore(path string) ([]string, error) {
|