Skip to content

Commit fe06202

Browse files
FrenchBenMisty Stanley-Jones
authored andcommitted
Added note on tag formatting of docker image (docker#3207)
* Added note on tag formatting of docker image Signed-off-by: French Ben <frenchben@docker.com> * Updated notes Signed-off-by: French Ben <frenchben@docker.com>
1 parent bd18b17 commit fe06202

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

engine/admin/logging/awslogs.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ $ docker run --log-driver=awslogs \
7474
...
7575
```
7676

77-
> **Note:**
77+
> **Note**:
7878
> Your AWS IAM policy must include the `logs:CreateLogGroup` permission before you attempt to use `awslogs-create-group`.
7979
8080

@@ -87,6 +87,14 @@ When both `awslogs-stream` and `tag` are specified, the value supplied for `awsl
8787

8888
If not specified, the container ID is used as the log stream.
8989

90+
{% raw %}
91+
> **Note**:
92+
> 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`.
93+
> Template markup can be used to get the proper format.
94+
> 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}}'`
95+
> the output will be something like: `alpine_latest-bf0072049c76`
96+
{% endraw %}
97+
9098

9199
## Credentials
92100

0 commit comments

Comments
 (0)