-
Notifications
You must be signed in to change notification settings - Fork 86
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
DinD non-TLS / non-SSL mode of operation should not be crippled or removed #1313
Comments
Hmm.. so there is an exception in the code for the daemon listening on a loopback interface, but that won't apply in the docker-in-docker case https://github.com/moby/moby/blob/c4040417b6fe21911dc7ab5e57db27519dd44a6a/cmd/dockerd/daemon.go#L681-L687 Perhaps we need some "i-know-what-im-doing" env-var to skip 🤔 @AkihiroSuda @cyphar @cpuguy83 any thoughts? |
It is complaining about |
@cpuguy83 that is the case, however I will point out that: --tls=false / --tlsverify=false alone does not result in non-tls behaviour To get GOOD behaviour you MUST use both things. I feel like the cert dir variable should not matter and the argument should be the only thing to do. A dir setting controlling an entire behaviour? Seriously? :-D |
@fredcooke There is no such variable in this codebase. Is that from the dind image? |
Yep -- to be clear, the feature request I was suggesting was being able to listen on both TLS and non-TLS simultaneously, but the way the flags are designed that's a little complicated. |
This has caused similar difficulties for us in moving from docker 19.x to 20.10.x - TLS is not necessary in our use case (using the dind container as part of a k8s pod for ephemeral build nodes linked to Jenkins). However the delay in bringing up the daemon causes our builds to fail as the docker daemon doesn't respond quickly enough when the pod is initially brought up. We can configure TLS, but as mentioned by @fredcooke this adds unnecessary overhead where it is not needed. |
After four hours of debugging, I finally came to this issue. 🤦🏻♂️ Using DinD with GitLab pipelines, but got effected by this nevertheless. |
my solution was to run dind with a volume attached to daemon.json that has here's the full solution
with the following daemon.json:
|
You can also override the command used. In our case, the GitLab service looks like this: services:
- name: docker:dind
# Good
command: [ "dockerd", "-H", "tcp://0.0.0.0:2375", "--tls=false" ]
# Bad
# command: [ "--tls=false" ] Without overriding the whole command being executed (not only the arguments), dind would add the artificial wait time. |
worked, Thanks |
Expected behavior
Docker DinD Starts Quickly no matter which configuration option is chosen, and non-SSL operation is available long term for valid use cases.
Actual behavior
Docker DinD takes an additional 15 seconds to start when configured for non-SSL use without adding additional arguments to bypass the
sleep 15
and warns the user of impending feature removal of non-SSL behaviour.Steps to reproduce the behavior
Output of above
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.)
DinD
Valid Use Case for non-TLS Operation
When running in Kubernetes and using dind within a multi-container pod structure the underlying realaity is that the pods are on the same host and talking to each other over local loop back and that TLS doesn't really make sense, there is no man in the middle, anyone who is on the box already owns you and your entire cluster.
I've converted our stack over to SSL due to the threats of removal of behaviour and the extra hassle of making it not sleep 15 seconds during startup in a critical application. However the SSL startup is slower and the SSL communications over local loop back are slightly slower/more CPU intensive, and if someone is on the box and wants to MITM on the loop back interface then they have access to the certs/keys on disk anyway.
Thanks to @tianon who suggested putting this here.
Ref docker-library/docker#292
The text was updated successfully, but these errors were encountered: