-
Notifications
You must be signed in to change notification settings - Fork 245
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
ERROR: Cannot connect to the Docker daemon. Docker:dind #1049
Comments
How are you planning to use Docker? Despite "dind" being in the image's name, there are two ways of using this, with one obviously being DinD (Docker in Docker) and the other being sometimes referred to as "DooD" (Docker outside of Docker). What does your project configuration look like? For DinD, your configuration needs to permit privileged containers and your job needs to launch its own Docker daemon (i.e. within the container) before proceeding with whatever else you intend to do with that job (e.g. build an image). For DooD, your configuration needs to permit host mounts so that the Docker client within the container can connect to the Docker daemon running on whatever Kubernetes node the job gets assigned to. Hope this helps. If neither of these do, then it could be that there is something wrong with your cluster that is not specifically Brigade-related. |
@krancour -- Thanks for your reply. |
I think I should clarify something here. In your If it's not clear why... Imagine a hostile actor coming along and submitting a PR that modifies your
https://github.com/brigadecore/charts/blob/master/charts/brigade-project/values.yaml#L115-L122 In the chart, a project defaults to allowing privileged containers and whether host mounts are permitted is undefined (commented). The rendering logic in the chart's templates interprets undefined as I'll circle back to mentioning that the right combination of these settings depends on whether you're trying to do "DinD" or "DooD" in your job. |
@krancour -- thanks for the clarification, gained a lot of knowledge. I was using docker:dind image. |
@mayurkumar09 you may be using an image with "dind" in its name, but that image actually supports both the DinD and DooD approach. Can you clarify which you are attempting? DinD == start your own Docker daemon on tge container. DooD == use the host's Docker daemon. |
@krancour -- i was using DinD -- which was starting the docker daemon on the container. const { events, Job } = require("brigadier");
}); |
Ok. That looks quite right. Are this working with that + privileged containers permitted at the project level? |
yes this is working fine after creating brigade project with helm chart as by default there was allowPrivilegedJobs: "true" at project level. |
If you create the project via
|
@radu-matei it sounds like that is what he had done. @mayurkumar09 I'd be curious... if you walk through the steps of creating the project (or a new one similar to it) via |
@radu-matei -- ya i did same way previously. Thanks for the help!! @krancour -- Now docker daemon is running perfectly fine. Might be i was using some wrong permutation. But now its working fine both ways via brig and helm too. Thanks a lot for ur support. Below is the details of my brigade project : $ brig project get mayurkumar09/hellonode |
@mayurkumar09 sounds like you're all set. Glad to hear it. |
Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Docker daemon isn't getting up in docker:dind or other images that has docker. Tried via brig project create, as well as helm chart for brigade project.
no problem in the gke cluster too, while i'm trying from another machine.
Please help.
Thanks :)
Output of
brig version
: v1.2.1Output of
kubectl version
:Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.11-gke.14", GitCommit:"56d89863d1033f9668ddd6e1c1aea81cd846ef88", GitTreeState:"clean", BuildDate:"2019-11-07T19:12:22Z", GoVersion:"go1.12.11b4", Compiler:"gc", Platform:"linux/amd64"
Cloud Provider/Platform (AKS, GKE, Minikube etc.): GKE
The text was updated successfully, but these errors were encountered: