2017-01-07 9 views
6

Próbuję zmienić daemon.json w Dockerze dla systemu Windows (najnowsze aktualizacje systemu Windows 10 rocznica) 1.13.0-rc5, więc mogę zmienić ustawienie "hosts": [] tak:Zmiana "Docker" hosts/"-h" dla systemu Windows w daemon.json

{ 
    "hosts": [ 
    "tcp://0.0.0.0", 
    "http://0.0.0.0" 
    ] 
} 

jednak po zmianie ustawień za pomocą aplikacji ustawienia mam ten błąd:

Docker daemon failed with message: 
unable to configure the Docker daemon with file C:\ProgramData\docker\config\daemon.json: 
the following directives are specified both as a flag and in the 
configuration file: 
hosts: (from flag: [npipe:////./pipe/docker_engine_windows], 
from file: [tcp://0.0.0.0 http://0.0.0.0]) 

Wygląda na to demon jest już rozpoczął -H flagi i config json nie jest połączone z tym.

Jak możemy zmienić te ustawienia za pomocą pliku json lub zmienić parametry uruchamiania dockerd?

Odpowiedz

1

Masz podobny przypadek z issue 22339:

This is expected; you cannot specify options both as a flag and in the configuration file (daemon.json).
If you change your DOCKER_OPTS to DOCKER_OPTS="" and restart, then it should work. We explicitly don't "merge" these configurations.

Albo dodać docker.conf

[Service] 
ExecStart= 
ExecStart=/path/to/dockerd 
# or 
ExecStart=/path/to/dockerd daemon 

Ale oficjalne stanowisko pozostaje:

There's no bug in the systemd configuration, to override defaults in a systemd unit file, you can use a drop-in file, as described in " Custom Docker daemon options ".

Producing an error if both a flag and an option in daemon.json are provided was a design decision when implementing that (in general, flags should always have precedence over configuration files); automatically merging options was not an option, as this would lead to unexpected results (was the intent to override an option, or to add to an option?)

PR 27473 została odrzucona, gdyż issue 21559.

+0

Zobacz także https://github.com/docker/docker/pull/20410 – VonC

+0

Dzięki za odpowiedź. Widziałem również ten pr/problem. Jednak jestem w systemie Windows. Jak mogę zmienić domyślne progi dla dockerd, więc mogę dodać -H tam zamiast w pliku? –

+0

Też szukam tego - dość denerwujące, że Docker dla Windows wydaje się uruchamiać usługę z flagą -H. Wygląda na to, że umieścisz to jako domyślne w daemon.json, który by działał zamiast tego? –

Powiązane problemy