-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Conflict between default -H fd://
systemd config and daemon.json hosts
config
#25471
Comments
Also it is true that in the case of systemd, adding |
Yes I would agree, best to use one place or the other. The decision was made that the config would conflict with the file, so this On 7 Aug 2016 1:06 p.m., "Steve Durrheimer" [email protected]
|
I wonder if we should remove the socket activation altogether in the default setup; we removed it for RPM setups (where it caused issues in combination with live restore). That way, the unit file could remove the |
That would seem consistent, socket activation doesn't seem sensible really Maybe there is a case for making listen address an exception that can be On 7 Aug 2016 4:04 p.m., "Sebastiaan van Stijn" [email protected] I wonder if we should remove the socket activation altogether in the — Reply to this email directly, view it on GitHub |
I thought about that, we should keep in mind that multiple addresses can be specified (e.g. both a socket, and an IP address); would specifying it in Reason for erring out originally was to prevent weird behavior ("I specified a flag, but it's not working"), also it may be odd to ignore a flag (flags should always take precedence IMO) |
It would have to append, vs the current conflict. Not sure it is a good On 7 Aug 2016 4:45 p.m., "Sebastiaan van Stijn" [email protected]
|
So while potentially somewhat off topic the removal of fd:// on RHEL/RPM was somewhat disastrous. The default docks you get from searching still show using fd:// in the docker.service file, and anyone on RHEL will already be trying to implement those changes since by default you get a docker/docker-network/etc. in /etc/sysconfig, so for I would say a significant portion of RHEL users, the 1.12 installation broke for them since many still had "fd://" in their docker.service files and that didn't get replaced with package upgrade to 1.12. As to socket activation being non-useful for most applications: I'm curious what everyone believes the default connection methodology is? TCP? By default the unix:/// socket requires users to implement DOCKER_HOST AND be put into the docker group (security hole) or be given sudo permissions...not as much of a security hole. FD was a good generic solution to local access in some cases. It was the "it just works" solution. With the removal RHEL admins were having to scramble to get their docker installs back up and running. I would be concerned what would happen if we broke Ubuntu installs the same way. |
Afaik, the default does not require a I agree that migrating to remove |
@thaJeztah But, isn't that the only way that someone could install the engine and also bind it to a port? Either I have to add FWIW I ran into exactly this on a couple of 'pet' hosts when I was updating from v1.11 -> v1.12. |
The "right" way to modify unit files is via systemd drop-ins: https://docs.docker.com/engine/admin/systemd/#/custom-docker-daemon-options |
isn't it a sensible default to fallback on fd:// if not specified so it can be omitted in the standard /lib/systemd/system/docker.service ExecStart ? currently you have to edit the docker.service in order to specify/add the remote-api host and it makes more sense to use daemon.json for that |
@tubbynl No, it should not fallback to Docker does fallback to unix sockets when no host is specified. |
that's a curious thing; i ran into this using a clean install (yesterday) from the docker debian-jessie repository (Docker version 1.12.1, build 23cf638) and the -H fd:// parameter was specified in my /lib/systemd/system/docker.service file is that not supposed to be there then? |
Ok, I give up... I don't know what's up. |
For |
just verified it with a clean virtualbox instance using debian-8.5.0-amd64-netinst Linux local-dev 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux
yields
|
Correct, socket activation was only removed for RPM based installs, because on those installs, socket activation caused problems with live-restore (see this directory; there's a separate unit file for RPM based installs: https://github.com/docker/docker/tree/v1.12.1/contrib/init/systemd). Socket activation is still in place for .deb installs. Wondering if we should remove it altogether. |
Sorry if i post in wrong place >> service docker status
● docker.service
Loaded: loaded (/etc/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since чт 2016-10-20 00:39:06 EEST; 1min 33s ago
Process: 28828 ExecStart=/usr/bin/dockerd $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=1/FAILURE)
Main PID: 28828 (code=exited, status=1/FAILURE)
жов 20 00:39:06 moonbrv-580 systemd[1]: Started docker.service.
жов 20 00:39:06 moonbrv-580 dockerd[28828]: time="2016-10-20T00:39:06+03:00" level=fatal msg="unable to configure the Docker daemon with file /etc/docker/daemon.json: EOF\n"
жов 20 00:39:06 moonbrv-580 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
жов 20 00:39:06 moonbrv-580 systemd[1]: docker.service: Unit entered failed state.
жов 20 00:39:06 moonbrv-580 systemd[1]: docker.service: Failed with result 'exit-code'. In my docker.service i have >> grep 'ExecStart' /lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS I did remove [Service]
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
ExecStart=
ExecStart=/usr/bin/dockerd $OPTIONS \
$DOCKER_STORAGE_OPTIONS \
$DOCKER_NETWORK_OPTIONS \
$BLOCK_REGISTRY \
$INSECURE_REGISTRY Text the same as in docs... I just don't understand what wrong. |
@moonbrv try the following
PS: Below the
And the
|
This patch fixes docker installation for OSes using systemd.
I just hit this on a new install on Ubuntu 16.04 after running Docker for years on Ubuntu 16.04. I think that expecting people to know this much detail about systemd is a big problem because it took me quite a while to even find the relevant error message in |
Yep, bug has been open for more than one year and there is not even an hint in the documentation. |
@dmitriyse: don't patch the systemd files directly but use systemd drop-in (as suggested by @czerasz 3 comments up): # As root
mkdir -p /etc/systemd/system/docker.service.d
echo '[Service]
ExecStart=
ExecStart=/usr/bin/dockerd' > /etc/systemd/system/docker.service.d/simple_dockerd.conf
systemctl daemon-reload
service docker restart This way you only override the |
Thanks , this tip works great. |
Please add this tip somewhere in the documentation. It's too difficult to find the right answer. |
Not sure why the "workarounds" are considered the known and good practice. It's good we have workarounds but shouldn't this just work? Docker should update their codebase to be able to handle this; docs aside. |
@snth use |
the issue with TLS reproduced again if i remove TLS from /etc/docker/daemon.json it works fine docker engine:18.09.1 |
It seems the issue with
first |
The issue was there in all releases, but socket-activation wasn't available on all distros for some releases (and only set in |
@thaJeztah |
another one there. if it starts by default - ok. systemd. and no that suckish workarounds, which leads to adding unnecessary files to track. |
How about removing socket activation entirely so that daemon.json works (as documented which is recommended to be used)? Instead of documenting how to workaround socket activation, simply document how to enable socket activation for those who want it. You can specify remote hosts and define socket activation in the hosts field of daemon.json. While we're at it also document what are socket activations uses/benefits because I've seen this term said a lot here but have yet to read any practical use for it. |
I try a this and works for me:
my daemon.json final:
then:
And docker runs now |
Using
hosts
configuration indaemon.json
file is conflicting with the default systemd-H fd://
config.Of course, I can edit the
/lib/systemd/system/docker.service
file or duplicate it as/etc/systemd/system/docker.service
or even add a complementary config file in/etc/systemd/system/docker.service.d/
to change theExecStart
command.But then it would imply to maintain this change instead of simply use the
daemon.json
file to customize daemon options.Output of
docker version
:Output of
docker info
:daemon.json:
Steps to reproduce the issue:
docker.service
from apt packagehosts
configuration in/etc/docker/daemon.json
sudo systemctl restart docker
Describe the results you received:
Docker failed to start.
Describe the results you expected:
Docker started.
The text was updated successfully, but these errors were encountered: