-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
DOCKER_OPTS do not work in config file /etc/default/docker #9889
Comments
What distro are you using (including version), and where did you get the docker package from, and what version is it? |
I have memtioned it within the question. Docker version 1.4.1, ubuntu 14.04. I'm following the installation guides to install latest version |
I don't seem to be having the same problem. Can you paste the output of your |
I have installed docker locally yesterday and (probably) ran into this problem. In my case the problem was, that the new docker version (1.4.1) comes with this new /etc/default/docker file (maybe even earlier versions, but the last version I installed and only updated since then on my server, only had the DOCKER_OPTS variable in it and I think it was just empty and not commented out), which has all that stuff in it, but it's all commented out by default. |
@stozk +1 for figuring it out though! |
I upgrade docker version 1.3.1 to 1.4.1 and run into this problem. Finally I got my problem resolved by reboot my ubuntu server. Maybe, @stozk is right. |
I'm still having this issue.
|
got into the same issue. |
I've also encountered this problem (Debian Jessie 8.0, lxc-docker=1.6.2). After a look around at the configuration files in
I edited Again, I'm on Debian Jessie 8.0 with lxc-docker=1.6.2, so YMMV. |
Correct, the This is also mentioned at the top of the file; |
Fair point. On my Debian system, however, the systemd services in |
@zepalmer if I'm not mistaken, there's currently some work being done on the installation for those systems, but I'm not 100% clear on what the status is and what changes are made 😊 |
@zepalmer, as the latest version of the documentation suggests (http://docs.master.dockerproject.org/articles/systemd/), the proper way to edit systemd service file is to create a file in |
Good to know, thanks. My apologies for cluttering up the bug report. :) |
@zepalmer no problem! |
This tripped me up a lot on Ubuntu 15.04 using Docker 1.8.0 experimental via the shell script install process. My assumption is the apt repository package does not provide a proper docker systemd unit file yet? I ended up having to do a double ExecStart in my override file to clear the original else it would complain about two ExecStart's on a oneshot. I.e. in /etc/systemd/system/docker.service.d/docker.conf
|
thanks for me, my settings were simply located in /etc/systemd/docker file FYI
|
Hi, I can't find the commits 5c7fa42 and 0e7fb27 any more. Were they published to a branch which is now deleted? I think, the should be merged into master and/or to the release branch immediately! |
See moby#9889 (specifically, [here](moby#9889 (comment)). The systemd daemon should support `DOCKER_OPTS` the same as upstart and sysv do. This commit is copied from moby@0e7fb27 The commit itself is not present anymore (maybe it's orphaned?).
See moby#9889 (specifically, [here](moby#9889 (comment)). The systemd daemon should support `DOCKER_OPTS` the same as upstart and sysv do. This commit is copied from moby@0e7fb27 The commit itself is not present anymore (maybe it's orphaned?). Signed-off-by: Matthias Brandt <matthias.brandt@inoio.de>
@mattelacchiato no they were not. https://coreos.com/os/docs/latest/using-systemd-drop-in-units.html |
Apparently you can override the entire unit file like so:
and then replacing whatever you need in the new file located within /etc. |
@netbrain also see the documentation, which contains some example to override more fine-grained: https://docs.docker.com/articles/systemd/#custom-docker-daemon-options |
@stozk 👍 for providing the fix. |
see moby/moby#9889 huge thx to @resouer this needs still lots of cleanup but now completely works
@thaJeztah That link fixed my issue too. I could clearly see that adding things to /etc/sysconfig/docker was not doing anything but I wasn't really sure the best way to fix it. Is there anyone I could notify to let them know the docs are wrong on this page: Or at least put in a link for systemd (Red Hat) installs so others can figure it out faster: |
Having gone down this road twice here's my take for Debian Jessie: Debian GNU/Linux 8 (jessie) / Docker version 1.12.3
Change this line:
Check it Would be great if /etc/default/docker file wasn't installed on systemd setups. |
@rjarmstrong you should not modify the main systemd unit file; doing so will result in the unit file not being updated if you update a newer version of docker, which can result in issues. If you want to change the systemd unit file, use a drop-in file, as explained here; http://docs.docker.com/engine/articles/systemd/#custom-docker-daemon-options However, the easiest way to make changes to the daemon configuration is to use a |
Thanks @thaJeztah that works well - I went with editing |
Hi all, I'm using Ubuntu 16.10 and I have same problem: daemon not use DOCKER_OPTS config. Any ideas ? |
@carloscds did you take the time to read the discussion above before posting your question? |
@thaJeztah I already read this post and many others, but I can't solve my problem. |
@carloscds Don't use Use |
@cpuguy83 Thanks, I change configuration using daemon.json and now it's working! |
Why does the docker.io package install a systemd file that DOES source EnvironmentFile for additional config? Meanwhile docker-engine installs a different systemd file. Which package is correct? Why is docker.io still present if it's wrong? |
Which package is correct? Why is docker.io still present if it's wrong?
|
@eric-tucker "docker-engine" is the official package provided by Docker Inc, "docker.io" is provided by Canonical. It's important to note that "EnvironmentFile" is not shell compatible, meanwhile the old "/etc/default/docker" is expected to be sourced by a shell. The daemon.json file is the right place to put config. It supports hot-reloading of certain parameters and works on any distro, init system, whatever. |
@cpuguy83 so how does one define DOCKER_OPTS now then? In /etc/docker/daemon.json here?
I want to make sure I'm doing things correctly now. Edit: I was editing DOCKER_OPTS to specify an insecure registry. |
You don't define "DOCKER_OPTS". # /etc/default/docker
DOCKER_OPTS="--insecure-registry 1.2.3.4 -s overlay" # upstart config
source /etc/default/docker
exec docker daemon "$DOCKER_OPTS"
{
"insecure-registries": ["1.2.3.4"],
"storage-driver": "overlay"
} When docker starts, it reads this file and loads the configuration. |
I understood that DOCKER_OPTS was just a way to get command line options onto the daemon call. Hence why I was aware of the EnvironmentFile line in the docker.io version of /lib/systemd/system/docker.service. I know you have to assume we're all dumb in your replies though. :) Glad to know config has gotten simpler with a simple json file, but yaml would have been a better choice. :( |
@eric-tucker it helps for people that arrive on these issues through Google search, and may not be aware of the way things work. |
Good point @thaJeztah . The json config is working for me. Thanks @cpuguy83 and @vdemeester . |
The Debian package should not install SysVinit scripts and configuration files (e.g. /etc/default/docker) because they are not used. I filed this new issue: #30936 Thanks @zepalmer @rjarmstrong |
I think i have f***ed up my docker.service file. Can someone post me the original file of it? |
@chucky2305 latest version is here; https://github.com/moby/moby/tree/master/contrib/init/systemd, depending on if you're using an rpm-based system (CentOS, RHEL, Fedora), you only need the |
Using |
Example: |
how does one define DOCKER_OPTS="br0" now then? In /etc/docker/daemon.json here. |
@huntlin to set the "bridge" option? {"bridge": "br0"} |
@thaJeztah I trying now ,but I find out "ps -ef | grep docker" can't see what I just created br0. |
@thaJeztah and I found out "docker info" ,But he made a mistake "Is the docker daemon running?" |
( I was initially looking for how to add Sum-up for
|
I have changed
/etc/default/docker
withDOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock"
(docker version 1.4.1 in ubuntu 14.04), but it do not take any effect for me. It seems that docker do not read this initital config file because I foundexport http_proxy
enviroment do not work too.Only
sudo docker -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -d
works.It really confused me!
The text was updated successfully, but these errors were encountered: