From fe0620225d11533b9f4bf7aa37ca245e319dde99 Mon Sep 17 00:00:00 2001 From: French Ben Date: Tue, 9 May 2017 13:02:24 -0700 Subject: [PATCH] Added note on tag formatting of docker image (#3207) * Added note on tag formatting of docker image Signed-off-by: French Ben * Updated notes Signed-off-by: French Ben --- engine/admin/logging/awslogs.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/engine/admin/logging/awslogs.md b/engine/admin/logging/awslogs.md index c768b90416..963fe9d355 100644 --- a/engine/admin/logging/awslogs.md +++ b/engine/admin/logging/awslogs.md @@ -74,7 +74,7 @@ $ docker run --log-driver=awslogs \ ... ``` -> **Note:** +> **Note**: > Your AWS IAM policy must include the `logs:CreateLogGroup` permission before you attempt to use `awslogs-create-group`. @@ -87,6 +87,14 @@ When both `awslogs-stream` and `tag` are specified, the value supplied for `awsl If not specified, the container ID is used as the log stream. +{% raw %} +> **Note**: +> The CloudWatch log API doesn't support `:` in the log name. This can cause some issues when using the `{{ .ImageName }}` as a tag, since a docker image has a format of `IMAGE:TAG`, such as `alpine:latest`. +> Template markup can be used to get the proper format. +> To get the image name and the first 12 characters of the container id, you can use: `--log-opt tag='{{ with split .ImageName ":" }}{{join . "_"}}{{end}}-{{.ID}}'` +> the output will be something like: `alpine_latest-bf0072049c76` +{% endraw %} + ## Credentials