|
|
@@ -191,3 +191,18 @@ func TestUpProfile(t *testing.T) {
|
|
|
assert.Assert(t, strings.Contains(res.Combined(), `Container foo_c Created`), res.Combined())
|
|
|
assert.Assert(t, !strings.Contains(res.Combined(), `Container bar_c Created`), res.Combined())
|
|
|
}
|
|
|
+
|
|
|
+func TestUpImageID(t *testing.T) {
|
|
|
+ c := NewCLI(t)
|
|
|
+ const projectName = "compose-e2e-up-image-id"
|
|
|
+
|
|
|
+ digest := strings.TrimSpace(c.RunDockerCmd(t, "image", "inspect", "alpine", "-f", "{{ .ID }}").Stdout())
|
|
|
+ _, id, _ := strings.Cut(digest, ":")
|
|
|
+
|
|
|
+ t.Cleanup(func() {
|
|
|
+ c.RunDockerComposeCmd(t, "--project-name", projectName, "down", "-v")
|
|
|
+ })
|
|
|
+
|
|
|
+ c = NewCLI(t, WithEnv(fmt.Sprintf("ID=%s", id)))
|
|
|
+ c.RunDockerComposeCmd(t, "-f", "./fixtures/simple-composefile/id.yaml", "--project-name", projectName, "up")
|
|
|
+}
|