mirror of
https://github.com/docker/compose.git
synced 2026-09-01 07:11:06 +00:00
No rebuild on compose up if image already exists by default, added first use of compose pull_policy and compose up --build to allow to force rebuild.
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
parent
bb7b47be39
commit
cf378834e5
6 changed files with 41 additions and 20 deletions
|
|
@ -123,6 +123,9 @@ func TestLocalComposeBuild(t *testing.T) {
|
|||
c.RunDockerOrExitError("rmi", "custom-nginx")
|
||||
|
||||
res := c.RunDockerCmd("compose", "up", "-d", "--workdir", "fixtures/build-test")
|
||||
t.Cleanup(func() {
|
||||
c.RunDockerCmd("compose", "down", "--workdir", "fixtures/build-test")
|
||||
})
|
||||
|
||||
res.Assert(t, icmd.Expected{Out: "COPY static /usr/share/nginx/html"})
|
||||
|
||||
|
|
@ -133,6 +136,12 @@ func TestLocalComposeBuild(t *testing.T) {
|
|||
c.RunDockerCmd("image", "inspect", "custom-nginx")
|
||||
})
|
||||
|
||||
t.Run("no rebuild when up again", func(t *testing.T) {
|
||||
res := c.RunDockerCmd("compose", "up", "-d", "--workdir", "fixtures/build-test")
|
||||
|
||||
assert.Assert(t, !strings.Contains(res.Stdout(), "COPY static /usr/share/nginx/html"), res.Stdout())
|
||||
})
|
||||
|
||||
t.Run("cleanup build project", func(t *testing.T) {
|
||||
c.RunDockerCmd("compose", "down", "--workdir", "fixtures/build-test")
|
||||
c.RunDockerCmd("rmi", "build-test_nginx")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue