2017-01-07 9 views
6

में बदलें, मैं विंडोज़ के लिए डॉकर पर daemon.json को बदलने की कोशिश कर रहा हूं (विंडोज 10 यूनिवर्सरी नवीनतम अपडेट स्थापित) 1.13.0-आरसी 5 इसलिए मैं "hosts": [] सेटिंग बदल सकता हूं इस तरह:विंडोज़ के लिए "मेजबान"/"-h" डॉकर को daemon.json

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

हालांकि, बाद सेटिंग एप्लिकेशन का उपयोग करके मैं यह त्रुटि आई सेटिंग में बदलाव:

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]) 

ऐसा लगता है कि पहले से ही डेमॉन -H ध्वज के साथ शुरू कर दिया जाता है और json config विलय नहीं किया जाता इसके साथ।

तो, हम उन सेटिंग्स को या तो json फ़ाइल द्वारा बदल सकते हैं या डॉकर्ड स्टार्टअप पैरामीटर बदल सकते हैं?

उत्तर

1

आप 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.

या docker.conf में जोड़ने

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

लेकिन आधिकारिक रुख रहता है:

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 अस्वीकार कर दिया था, के लिए issue 21559

+0

https://github.com/docker/docker/pull/20410 – VonC

+0

उत्तर के लिए धन्यवाद भी देखें। मैंने उस पीआर/मुद्दे को भी देखा। हालांकि, मैं विंडोज़ पर हूं। मैं डिफ़ॉल्ट dockerd prameters कैसे बदल सकता हूं ताकि मैं फ़ाइल में बजाय -H जोड़ सकूं? –

+0

मैं यह भी ढूंढ रहा हूं - बहुत परेशान है कि विंडोज़ के लिए डॉकर -एच ध्वज के साथ सेवा शुरू करना प्रतीत होता है। ऐसा लगता है कि इसे डिमन में डिफ़ॉल्ट रूप में डालने जैसा लगता है। जेसन ने इसके बजाय काम किया होगा? –

संबंधित मुद्दे