From e06245ea9531ae63810b99e62221b75abbfaee13 Mon Sep 17 00:00:00 2001 From: Kibubu <85624897+Kibubu@users.noreply.github.com> Date: Tue, 9 May 2023 15:00:05 +0200 Subject: [PATCH] Add info invalid references (#17224) * Add info invalid references The example shows a configuration that would raise a invalid image reference error if the environment variable for the image is set to an empty string or is not set at all. Also the code format ticks included the period. #17192 A warning was added to highlight the incorrect configuration and the ticks now exclude the period. * Apply suggestions from code review --------- Co-authored-by: Allie Sadler <102604716+aevesdocker@users.noreply.github.com> --- compose/environment-variables/set-environment-variables.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compose/environment-variables/set-environment-variables.md b/compose/environment-variables/set-environment-variables.md index 2b81b3a554..0514f7a0cd 100644 --- a/compose/environment-variables/set-environment-variables.md +++ b/compose/environment-variables/set-environment-variables.md @@ -109,7 +109,11 @@ db: When you run `docker compose up` with this configuration, Compose looks for the `POSTGRES_VERSION` environment variable in the shell and substitutes its value in. For this example, Compose resolves the image to `postgres:9.3` before running the configuration. -If an environment variable is not set, Compose substitutes with an empty string. In the example above, if `POSTGRES_VERSION` is not set, the value for the image option is `postgres:.` +If an environment variable is not set, Compose substitutes with an empty string. In the example above, if `POSTGRES_VERSION` is not set, the value for the image option is `postgres:`. + +> **Note** +> +> `postgres:` is not a valid image reference. Docker expects either a reference without a tag, like `postgres` which defaults to the latest image, or with a tag such as `postgres:15`. > **Important** >