1

Docker version:

Version: 1.12.2
API version: 1.24
Go version: go1.7
Git commit: 8eab29e
OS/Arch: linux/amd64

Docker info:

Storage Driver: btrfs
Build Version: Btrfs v4.1.2+20151002
Library Version: 101
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: host bridge null overlay
Swarm: inactive
Runtimes: oci runc
Default Runtime: oci
Security Options: apparmor
Kernel Version: 4.4.21-68-default
Operating System: SUSE Linux Enterprise Server 12 SP2
OSType: linux
Architecture: x86_64
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/

Issue:

docker config
/etc/sysconfig/docker
DOCKER_OPTS="--insecure-registry=0.0.0.0/0 --bip=127.12.7.1/24 --ip-forward=false --log-level=debug"

docker run -it --rm busybox /bin/sh

It fails with the following error:

docker: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"process_linux.go:334: running prestart hook 0 caused \\\"error running hook: exit status 1, stdout: , stderr: time=\\\\\\\"2016-10-27T20:51:30Z\\\\\\\" level=fatal msg=\\\\\\\"failed to set gateway while updating gateway: route for the gateway 127.12.7.1 could not be found: invalid argument\\\\\\\" \\\\n\\\"\"\n".

Note that with --bip=172.17.0.1/16 (which is default) or if I remove the --bip option there is no such issue.

Anyone has seen this or has a suggestion?

  • Has docker created a bridge (probably docker0) with address the given ip address? – larsks Oct 31 '16 at 14:04
  • 172.17.0.1/16 was the default ip of docker0 (bridge) interface. However, I need to use another like 127.12.7.1/24 that fails. – J H Nov 2 '16 at 6:06
0

Choose any other address. If the address starts with 127, it is part of the 127.0.0.0/8 subnet and that is reserved for loopback purposes (as 127.0.0.1 is localhost). Any other private address should work.

0

The solution I found was to remove this config from docker config. MountFlags=private and restart docker service.

-2

Have you tried restarting docker?

service docker restart

It solved my issue.

  • I saw that option in a github post, however it didn't work for me. – J H Nov 2 '16 at 6:07
  • The question is clearly asking about an issue when configuring the docker daemon, and it's clearly being restarted (otherwise changing the DOCKER_OPTS variable wouldn't have any effect, and it clearly does according to the second to last sentence). – nert Jun 23 '17 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.