Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit b4e4e4e

Browse files
committed
init http protocol based volumes
Signed-off-by: Peng Tao <bergwolf@gmail.com>
1 parent 67e0895 commit b4e4e4e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

api/client/run.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"io"
66
"os"
77
"runtime"
8+
"strconv"
89
"strings"
910

1011
"github.com/Sirupsen/logrus"
@@ -166,8 +167,8 @@ func (cli *DockerCli) initSpecialVolumes(config *container.Config, hostConfig *c
166167
case "git":
167168
cmd = append(cmd, "git", "clone", vol.Source, INIT_VOLUME_PATH+vol.Destination)
168169
case "http":
169-
// TODO
170-
// cmd = append(cmd, "wget", "--no-check-certificate", "--tries=5", "--mirror", vol.Source, "--directory-prefix="+INIT_VOLUME_PATH+vol.Destination)
170+
parts := strings.Split(vol.Source, "/")
171+
cmd = append(cmd, "wget", "--no-check-certificate", "--tries=5", "--mirror", "--no-host-directories", "--cut-dirs="+strconv.Itoa(len(parts)), vol.Source, "--directory-prefix="+INIT_VOLUME_PATH+vol.Destination)
171172
case "local":
172173
// TODO
173174
default:

0 commit comments

Comments
 (0)