iron-io / functions

IronFunctions - the serverless microservices platform by
https://iron.io
Apache License 2.0
3.17k stars 227 forks source link

DinD Why? #632

Open prologic opened 6 years ago

prologic commented 6 years ago

I'm not having a lot of success getting a e2e simple example going :/

Noticed while poking around that DinD is being used as a way to run the functions?

$ dki --rm -v /var/run/docker.sock:/var/run/docker.sock iron/functions --help
+ sleep 3
+ /usr/local/bin/dind.sh
+ cut -f2
+ grep -Eh -w -m1 overlay|aufs /proc/filesystems
+ fsdriver=overlay
+ [ overlay == overlay ]
+ fsdriver=overlay2
+ cmd=dockerd       --host=unix:///var/run/docker.sock      --host=tcp://0.0.0.0:2375       --storage-driver=overlay2
+ eval dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay2
+ dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay2
can't create unix socket /var/run/docker.sock: device or resource busy
+ echo Docker crashed with exit code 1.  Respawning..
Docker crashed with exit code 1.  Respawning..
+ pidfile=/var/run/docker/libcontainerd/docker-containerd.pid
+ cat /var/run/docker/libcontainerd/docker-containerd.pid
cat: can't open '/var/run/docker/libcontainerd/docker-containerd.pid': No such file or directory
+ kill -9
sh: you need to specify whom to kill
+ exec --help
/usr/local/bin/entrypoint.sh: exec: line 1: --help: not found

Why? This seems like a poor design choice to me -- not the least which the Docker engine being spawned doesn't seem to be running successfully without crashing.

dylanz commented 6 years ago

@prologic I believe the original motivation of using DinD is explained here. It looks like there is a way to run directly, but the default being DinD is definitely a talking point.

prologic commented 6 years ago

Yeah I can't think of any good reasons why DinD should be the default here or why you'd want functions to run inside Docker inside Docker.

It also means if you want to scale those functions you'd have to scale the DinD environment too Uggh

James Mills / prologic

E: prologic@shortcircuit.net.au W: prologic.shortcircuit.net.au

On Thu, Sep 7, 2017 at 9:12 AM, Dylan Stamat notifications@github.com wrote:

@prologic https://github.com/prologic I believe the original motivation of using DinD is explained here https://github.com/iron-io/functions/blob/3c4261ae37accf6c51a6aee6b216f58c84621d6c/docs/operating/options.md. It looks like there is a way to run directly, but the default being DinD is definitely a talking point.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/iron-io/functions/issues/632#issuecomment-327846545, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOv-v-t9f9t_q0gc5_8WO_RjRe1nEYiks5sgBSIgaJpZM4O0cvQ .