| ... | ... |
@@ -9,6 +9,7 @@ import ( |
| 9 | 9 |
|
| 10 | 10 |
"github.com/docker/docker/daemon" |
| 11 | 11 |
"github.com/docker/docker/engine" |
| 12 |
+ "github.com/docker/docker/graph" |
|
| 12 | 13 |
"github.com/docker/docker/pkg/archive" |
| 13 | 14 |
"github.com/docker/docker/pkg/parsers" |
| 14 | 15 |
"github.com/docker/docker/registry" |
| ... | ... |
@@ -42,7 +43,18 @@ func (b *BuilderJob) CmdBuild(job *engine.Job) engine.Status {
|
| 42 | 42 |
) |
| 43 | 43 |
job.GetenvJson("authConfig", authConfig)
|
| 44 | 44 |
job.GetenvJson("configFile", configFile)
|
| 45 |
+ |
|
| 45 | 46 |
repoName, tag = parsers.ParseRepositoryTag(repoName) |
| 47 |
+ if repoName != "" {
|
|
| 48 |
+ if _, _, err := registry.ResolveRepositoryName(repoName); err != nil {
|
|
| 49 |
+ return job.Error(err) |
|
| 50 |
+ } |
|
| 51 |
+ if len(tag) > 0 {
|
|
| 52 |
+ if err := graph.ValidateTagName(tag); err != nil {
|
|
| 53 |
+ return job.Error(err) |
|
| 54 |
+ } |
|
| 55 |
+ } |
|
| 56 |
+ } |
|
| 46 | 57 |
|
| 47 | 58 |
if remoteURL == "" {
|
| 48 | 59 |
context = ioutil.NopCloser(job.Stdin) |