|
@@ -773,6 +773,29 @@ func TestBuildExpose(t *testing.T) {
|
|
logDone("build - expose")
|
|
logDone("build - expose")
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func TestBuildEmptyEntrypoint(t *testing.T) {
|
|
|
|
+ name := "testbuildentrypoint"
|
|
|
|
+ defer deleteImages(name)
|
|
|
|
+ expected := "[]"
|
|
|
|
+
|
|
|
|
+ _, err := buildImage(name,
|
|
|
|
+ `FROM busybox
|
|
|
|
+ ENTRYPOINT []`,
|
|
|
|
+ true)
|
|
|
|
+ if err != nil {
|
|
|
|
+ t.Fatal(err)
|
|
|
|
+ }
|
|
|
|
+ res, err := inspectField(name, "Config.Entrypoint")
|
|
|
|
+ if err != nil {
|
|
|
|
+ t.Fatal(err)
|
|
|
|
+ }
|
|
|
|
+ if res != expected {
|
|
|
|
+ t.Fatalf("Entrypoint %s, expected %s", res, expected)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ logDone("build - empty entrypoint")
|
|
|
|
+}
|
|
|
|
+
|
|
func TestBuildEntrypoint(t *testing.T) {
|
|
func TestBuildEntrypoint(t *testing.T) {
|
|
name := "testbuildentrypoint"
|
|
name := "testbuildentrypoint"
|
|
expected := "[/bin/echo]"
|
|
expected := "[/bin/echo]"
|
|
@@ -791,6 +814,7 @@ func TestBuildEntrypoint(t *testing.T) {
|
|
if res != expected {
|
|
if res != expected {
|
|
t.Fatalf("Entrypoint %s, expected %s", res, expected)
|
|
t.Fatalf("Entrypoint %s, expected %s", res, expected)
|
|
}
|
|
}
|
|
|
|
+
|
|
logDone("build - entrypoint")
|
|
logDone("build - entrypoint")
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1184,7 +1208,7 @@ func TestContextTarNoCompression(t *testing.T) {
|
|
testContextTar(t, archive.Uncompressed)
|
|
testContextTar(t, archive.Uncompressed)
|
|
}
|
|
}
|
|
|
|
|
|
-func TestNoContext(t *testing.T) {
|
|
|
|
|
|
+func TestBuildNoContext(t *testing.T) {
|
|
buildCmd := exec.Command(dockerBinary, "build", "-t", "nocontext", "-")
|
|
buildCmd := exec.Command(dockerBinary, "build", "-t", "nocontext", "-")
|
|
buildCmd.Stdin = strings.NewReader("FROM busybox\nCMD echo ok\n")
|
|
buildCmd.Stdin = strings.NewReader("FROM busybox\nCMD echo ok\n")
|
|
|
|
|
|
@@ -1899,3 +1923,24 @@ func TestBuildCleanupCmdOnEntrypoint(t *testing.T) {
|
|
}
|
|
}
|
|
logDone("build - cleanup cmd on ENTRYPOINT")
|
|
logDone("build - cleanup cmd on ENTRYPOINT")
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func TestBuildClearCmd(t *testing.T) {
|
|
|
|
+ name := "testbuildclearcmd"
|
|
|
|
+ defer deleteImages(name)
|
|
|
|
+ _, err := buildImage(name,
|
|
|
|
+ `From scratch
|
|
|
|
+ ENTRYPOINT ["/bin/bash"]
|
|
|
|
+ CMD []`,
|
|
|
|
+ true)
|
|
|
|
+ if err != nil {
|
|
|
|
+ t.Fatal(err)
|
|
|
|
+ }
|
|
|
|
+ res, err := inspectFieldJSON(name, "Config.Cmd")
|
|
|
|
+ if err != nil {
|
|
|
|
+ t.Fatal(err)
|
|
|
|
+ }
|
|
|
|
+ if res != "[]" {
|
|
|
|
+ t.Fatalf("Cmd %s, expected %s", res, "[]")
|
|
|
|
+ }
|
|
|
|
+ logDone("build - clearcmd")
|
|
|
|
+}
|