+
Skip to content

Broken log option for awslogs log driver #50346

Open
@aaithal

Description

@aaithal

Description

Officially, the log option 'awslogs-create-stream' is supported for the awslogs log driver (ref). But, because of a code bug, using that option results in a failure to run the container.

The code bug is a missing check for this parameter in

func ValidateLogOpt(cfg map[string]string) error {

Reproduce

  1. run a container with this log option docker run --rm --log-driver=awslogs --log-opt awslogs-region=us-west-2 --log-opt awslogs-group=some-log-group --log-opt awslogs-stream=my-container --log-opt awslogs-create-stream=true public.ecr.aws/amazonlinux/amazonlinux:minimal
  2. Verify that you see this error response: docker: Error response from daemon: unknown log opt 'awslogs-create-stream' for awslogs log driver. See 'docker run --help'.

Expected behavior

This error should not be displayed and the container should run successfully.

docker version

Client:
 Version:           25.0.8
 API version:       1.44
 Go version:        go1.23.8
 Git commit:        0bab007
 Built:             Fri May 16 16:25:26 2025
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          25.0.8
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.23.8
  Git commit:       71907ca
  Built:            Fri May 16 16:25:56 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          2.0.5
  GitCommit:        fb4c30d4ede3531652d86197bf3fc9515e5276d9
 runc:
  Version:          1.2.4
  GitCommit:        6c52b3fc541fb26fe8c374d5f58112a0a5dbda66
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    25.0.8
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  0.12.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx

Server:
 Containers: 414
  Running: 0
  Paused: 0
  Stopped: 414
 Images: 774
 Server Version: 25.0.8
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: fb4c30d4ede3531652d86197bf3fc9515e5276d9
 runc version: 6c52b3fc541fb26fe8c374d5f58112a0a5dbda66
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 5.10.238-212.953.amzn2int.x86_64
 Operating System: Amazon Linux 2
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.05GiB
 Name: dev-dsk-aithal-2b-a20ea5fa.us-west-2.amazon.com
 ID: 7bcc2ba8-39d0-461e-aaea-9dc333420892
 Docker Root Dir: /local/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.status/0-triage

    Type

    No type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载