Signed-off-by: Antonio Murdaca <me@runcom.ninja>
| ... | ... |
@@ -20,7 +20,6 @@ |
| 20 | 20 |
package builder |
| 21 | 21 |
|
| 22 | 22 |
import ( |
| 23 |
- "errors" |
|
| 24 | 23 |
"fmt" |
| 25 | 24 |
"io" |
| 26 | 25 |
"os" |
| ... | ... |
@@ -42,10 +41,6 @@ import ( |
| 42 | 42 |
"github.com/docker/docker/utils" |
| 43 | 43 |
) |
| 44 | 44 |
|
| 45 |
-var ( |
|
| 46 |
- ErrDockerfileEmpty = errors.New("Dockerfile cannot be empty")
|
|
| 47 |
-) |
|
| 48 |
- |
|
| 49 | 45 |
// Environment variable interpolation will happen on these statements only. |
| 50 | 46 |
var replaceEnvAllowed = map[string]struct{}{
|
| 51 | 47 |
command.Env: {},
|
| ... | ... |
@@ -225,7 +220,7 @@ func (b *Builder) readDockerfile() error {
|
| 225 | 225 |
return fmt.Errorf("Cannot locate specified Dockerfile: %s", origFile)
|
| 226 | 226 |
} |
| 227 | 227 |
if fi.Size() == 0 {
|
| 228 |
- return ErrDockerfileEmpty |
|
| 228 |
+ return fmt.Errorf("The Dockerfile (%s) cannot be empty", origFile)
|
|
| 229 | 229 |
} |
| 230 | 230 |
|
| 231 | 231 |
f, err := os.Open(filename) |
| ... | ... |
@@ -3504,7 +3504,7 @@ func TestBuildFailsDockerfileEmpty(t *testing.T) {
|
| 3504 | 3504 |
defer deleteImages(name) |
| 3505 | 3505 |
_, err := buildImage(name, ``, true) |
| 3506 | 3506 |
if err != nil {
|
| 3507 |
- if !strings.Contains(err.Error(), "Dockerfile cannot be empty") {
|
|
| 3507 |
+ if !strings.Contains(err.Error(), "The Dockerfile (Dockerfile) cannot be empty") {
|
|
| 3508 | 3508 |
t.Fatalf("Wrong error %v, must be about empty Dockerfile", err)
|
| 3509 | 3509 |
} |
| 3510 | 3510 |
} else {
|