diff --git a/cluster/engine.go b/cluster/engine.go index b62efa822d..9ac3986d76 100644 --- a/cluster/engine.go +++ b/cluster/engine.go @@ -773,7 +773,7 @@ func (e *Engine) String() string { func (e *Engine) handler(ev *dockerclient.Event, _ chan error, args ...interface{}) { // Something changed - refresh our internal state. switch ev.Status { - case "pull", "untag", "delete": + case "pull", "untag", "delete", "commit": // These events refer to images so there's no need to update // containers. e.RefreshImages() diff --git a/test/integration/api/images.bats b/test/integration/api/images.bats index ffddeab25e..c6b3120b52 100644 --- a/test/integration/api/images.bats +++ b/test/integration/api/images.bats @@ -68,3 +68,13 @@ function teardown() { [ "${#lines[@]}" -eq 2 ] [[ "${lines[1]}" == *"testimage"* ]] } + +@test "docker images - after commit on engine side" { + start_docker_with_busybox 2 + swarm_manage + + docker -H ${HOSTS[0]} run -d --name test_container busybox sleep 500 + docker -H ${HOSTS[0]} commit test_container testimage + + retry 5 1 eval "docker_swarm images | grep 'testimage'" +}