From e1b87d7be0aa11f5f87762635a9e24d4e8849e77 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Fri, 26 Feb 2016 15:03:53 -0800 Subject: [PATCH] Update reference docs for the new flag. Signed-off-by: Daniel Nephin --- compose/service.py | 6 +++--- docs/reference/create.md | 15 ++++++++------- docs/reference/up.md | 34 ++++++++++++++++++---------------- tests/unit/service_test.py | 2 +- 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/compose/service.py b/compose/service.py index e2ddeb5a26..7ee441f2c8 100644 --- a/compose/service.py +++ b/compose/service.py @@ -294,9 +294,9 @@ def ensure_image_exists(self, do_build=BuildAction.none): self.build() log.warn( - "Image for service {} was build because it was not found. To " - "rebuild this image you must use the `build` command or the " - "--build flag.".format(self.name)) + "Image for service {} was built because it did not already exist. To " + "rebuild this image you must use `docker-compose build` or " + "`docker-compose up --build`.".format(self.name)) def image(self): try: diff --git a/docs/reference/create.md b/docs/reference/create.md index a785e2c704..5065e8bebe 100644 --- a/docs/reference/create.md +++ b/docs/reference/create.md @@ -12,14 +12,15 @@ parent = "smn_compose_cli" # create ``` +Creates containers for a service. + Usage: create [options] [SERVICE...] Options: ---force-recreate Recreate containers even if their configuration and - image haven't changed. Incompatible with --no-recreate. ---no-recreate If containers already exist, don't recreate them. - Incompatible with --force-recreate. ---no-build Don't build an image, even if it's missing + --force-recreate Recreate containers even if their configuration and + image haven't changed. Incompatible with --no-recreate. + --no-recreate If containers already exist, don't recreate them. + Incompatible with --force-recreate. + --no-build Don't build an image, even if it's missing. + --build Build images before creating containers. ``` - -Creates containers for a service. diff --git a/docs/reference/up.md b/docs/reference/up.md index a02358ec78..07ee82f934 100644 --- a/docs/reference/up.md +++ b/docs/reference/up.md @@ -15,22 +15,24 @@ parent = "smn_compose_cli" Usage: up [options] [SERVICE...] Options: --d Detached mode: Run containers in the background, - print new container names. - Incompatible with --abort-on-container-exit. ---no-color Produce monochrome output. ---no-deps Don't start linked services. ---force-recreate Recreate containers even if their configuration - and image haven't changed. - Incompatible with --no-recreate. ---no-recreate If containers already exist, don't recreate them. - Incompatible with --force-recreate. ---no-build Don't build an image, even if it's missing ---abort-on-container-exit Stops all containers if any container was stopped. - Incompatible with -d. --t, --timeout TIMEOUT Use this timeout in seconds for container shutdown - when attached or when containers are already - running. (default: 10) + -d Detached mode: Run containers in the background, + print new container names. + Incompatible with --abort-on-container-exit. + --no-color Produce monochrome output. + --no-deps Don't start linked services. + --force-recreate Recreate containers even if their configuration + and image haven't changed. + Incompatible with --no-recreate. + --no-recreate If containers already exist, don't recreate them. + Incompatible with --force-recreate. + --no-build Don't build an image, even if it's missing. + --build Build images before starting containers. + --abort-on-container-exit Stops all containers if any container was stopped. + Incompatible with -d. + -t, --timeout TIMEOUT Use this timeout in seconds for container shutdown + when attached or when containers are already + running. (default: 10) + ``` Builds, (re)creates, starts, and attaches to containers for a service. diff --git a/tests/unit/service_test.py b/tests/unit/service_test.py index 8631aa9291..199aeeb438 100644 --- a/tests/unit/service_test.py +++ b/tests/unit/service_test.py @@ -433,7 +433,7 @@ def test_create_container_with_build(self): service.create_container(do_build=BuildAction.none) assert mock_log.warn.called _, args, _ = mock_log.warn.mock_calls[0] - assert 'was build because it was not found' in args[0] + assert 'was built because it did not already exist' in args[0] self.mock_client.build.assert_called_once_with( tag='default_foo',