New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logs-opts seems broken in daemon.json #22311

Closed
pcarrier opened this Issue Apr 25, 2016 · 2 comments

Comments

Projects
None yet
5 participants
@pcarrier
Contributor

pcarrier commented Apr 25, 2016

Docker 1.10.3, binary from https://get.docker.com/builds/Linux/x86_64/docker-1.10.3

# cat /etc/docker/daemon.json
{ "log-opts": [ "env=FOO" ] }
# docker daemon
unable to configure the Docker daemon with file /etc/docker/daemon.json: json: cannot unmarshal array into Go value of type map[string]string

See #22309 for a similar issue.

@brandonstevens

This comment has been minimized.

Show comment
Hide comment
@brandonstevens

brandonstevens May 31, 2016

The following works on master:

{ "log-opts": { "env": "FOO" } }
Client:
 Version:      1.12.0-dev
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   ba372df
 Built:        Tue May 31 13:26:49 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.0-dev
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   ba372df
 Built:        Tue May 31 13:26:49 2016
 OS/Arch:      linux/amd64

Also, I'm currently using this successfully to set syslog options on 1.11.1:

{
  "log-driver": "syslog",
  "log-opts": {
    "tag": "{{.Name}}"
},
  "userland-proxy": false
}
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   5604cbe
 Built:        Wed Apr 27 00:34:42 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   5604cbe
 Built:        Wed Apr 27 00:34:42 2016
 OS/Arch:      linux/amd64

Is this an implementation or a documentation issue?

brandonstevens commented May 31, 2016

The following works on master:

{ "log-opts": { "env": "FOO" } }
Client:
 Version:      1.12.0-dev
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   ba372df
 Built:        Tue May 31 13:26:49 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.0-dev
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   ba372df
 Built:        Tue May 31 13:26:49 2016
 OS/Arch:      linux/amd64

Also, I'm currently using this successfully to set syslog options on 1.11.1:

{
  "log-driver": "syslog",
  "log-opts": {
    "tag": "{{.Name}}"
},
  "userland-proxy": false
}
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   5604cbe
 Built:        Wed Apr 27 00:34:42 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   5604cbe
 Built:        Wed Apr 27 00:34:42 2016
 OS/Arch:      linux/amd64

Is this an implementation or a documentation issue?

@pcarrier

This comment has been minimized.

Show comment
Hide comment
@pcarrier

pcarrier May 31, 2016

Contributor

Well, whether it's an implementation or documentation issue depends on which you think should be right.

The documentation at https://docs.docker.com/engine/reference/commandline/daemon/#daemon-configuration-file says "log-opts": [], and the code takes maps.

Pick whichever it should be and fix the other? :)

Contributor

pcarrier commented May 31, 2016

Well, whether it's an implementation or documentation issue depends on which you think should be right.

The documentation at https://docs.docker.com/engine/reference/commandline/daemon/#daemon-configuration-file says "log-opts": [], and the code takes maps.

Pick whichever it should be and fix the other? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment