Skip to content
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

Proxy settings in config.json not working: "cannot unmarshal string into Go struct field ConfigFile.proxies of type configfile.ProxyConfig" #507

Closed
alb-i986 opened this issue Sep 6, 2017 · 3 comments

Comments

@alb-i986
Copy link

alb-i986 commented Sep 6, 2017

Description
Trying the feature introduced in #93, pushed to 17.07.
Am I using the correct syntax?

Steps to reproduce the issue:

$ cat /home/alb/.docker/config.json
{ 
  "proxies" : {
    "httpProxy" : "http://myproxy:8080",
    "httpsProxy": "http://myproxy:8080",
    "noProxy": "localhost,127.0.0.1,my.lan"
  }
}

Describe the results you received:

$ docker -D pull jenkins/jenkins
WARNING: Error loading config file: /home/alb/.docker/config.json - json: cannot unmarshal string into Go struct field ConfigFile.proxies of type configfile.ProxyConfig
Using default tag: latest
[^C]

Output of docker version:

Docker version 17.07.0-ce, build 8784753

Output of docker info:

WARNING: Error loading config file: /home/alb/.docker/config.json - json: cannot unmarshal string into Go struct field ConfigFile.proxies of type configfile.ProxyConfig
Containers: 12
 Running: 0
 Paused: 0
 Stopped: 12
Images: 133
Server Version: 17.07.0-ce
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 267
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 3addd840653146c90a254301d6c3a663c7fd6429
runc version: 2d41c047c83e09a6d61d464906feb2a2f3c52aa4
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-92-generic
Operating System: Ubuntu 16.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.58GiB
Name: asd
ID: AEFZ:BUJ7:QUQX:WLOM:YEP6:BB5H:YNG6:CLR3:6V2Y:ZHVW:VP4Q:QJ7E
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support
@dnephin
Copy link
Contributor

dnephin commented Sep 6, 2017

It looks like they are keyed by host, or you can use default:

"proxies": {
  "default": {
     "httpProxy": ...,
},

@alb-i986
Copy link
Author

alb-i986 commented Sep 6, 2017

Thanks @dnephin
Now the syntax is correct, but the proxy is still not working.
I tried as the host key "default" and "localhost", with no luck.

$ docker --debug  pull jenkins/jenkins
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 127.0.1.1:53: read udp 127.0.0.1:50435->127.0.1.1:53: i/o timeout

@alb-i986
Copy link
Author

alb-i986 commented Sep 6, 2017

Sorry, my bad: it turns out that #93 implemented reading config.json only for build and run commands.
Works now, thanks!

Unfortunately my real use case is to use docker-compose to build and run containers, so I'm still out of luck.
Any plans applying the patch to docker-compose as well?

@alb-i986 alb-i986 closed this as completed Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants