Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Override daemon.json configuration #490

Closed
zloidemon opened this issue Oct 9, 2017 · 4 comments
Closed

Override daemon.json configuration #490

zloidemon opened this issue Oct 9, 2017 · 4 comments

Comments

@zloidemon
Copy link

I had my configuration:

{
	"hosts": [
		"tcp://127.0.0.1:2375",
		"unix:///var/run/docker.sock"
	]
}

After installation it changed to:

{
    "runtimes": {
        "nvidia": {
            "path": "/usr/bin/nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}

Although it should looks like

{
    "hosts": [
        "tcp://127.0.0.1:2375",
        "unix:///var/run/docker.sock"
    ],
    "runtimes": {
        "nvidia": {
            "path": "/usr/bin/nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}
@flx42
Copy link
Member

flx42 commented Oct 9, 2017

apt-get should have complained when the package was installed, right?

Unfortunately, it would not be trivial to merge our file with an existing one when installing the package. It would require merging 2 JSON files in a shell script.

Until we can have a better solution (maybe by asking the Docker community), did you consider using a systemd drop-in file for your other settings? That's what we do internally when deploying docker with a custom configuration + nvidia-docker 2.0. The base settings of dockerd (hosts, storage driver, bridge IP and CIDR range for docker0, log driver, etc.) are in the drop-in file.

That's what I have on my machine:

$ sudo cat /etc/systemd/system/docker.service.d/override.conf 
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --host=fd:// --storage-driver=overlay2

@flx42 flx42 added the 2.0 label Oct 9, 2017
@zloidemon
Copy link
Author

Yeah, I might add that configuration to init file, i've just showed the issue. I'm able to modify my files by hands. You can close that issue if it won't nvidia-docker issue

@eromoe
Copy link

eromoe commented Nov 20, 2017

I merge the file after nvidia-docker installed:

{
    "registry-mirrors": ["https://mytfd7zc.mirror.aliyuncs.com"],
    "insecure-registries" : [ "10.142.55.199:5006"] },
    "graph": "/data/dockerdata",
    "runtimes": {
        "nvidia": {
            "path": "/usr/bin/nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}

But still get error docker: Error response from daemon: Unknown runtime specified nvidia.

@flx42
Copy link
Member

flx42 commented Nov 20, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants