Open mmoles-Growlink opened 1 week ago
Admittedly I'm not an docker expert, so I have no idea how to improve things. If you come up with a solution I'll happily accept a pull request.
I'm lost as well. I believe this is a security issue, something like AppArmor maybe. I really don't know what I am doing with that kind of stuff. With docker I have learned that you can't always trust error messages to mean what they say.
In any case, your DinD is cool because even if it works in this nested fashion , it proves that version can run on that system.
docker run -d --restart unless-stopped --privileged -it -v /var/run/docker.sock:/var/run/docker.sock -v /sys/fs/cgroup:/sys/fs/cgroup:rw -e connectionString='<IOT_EDGE_DEVICE_CONNECTION_STRING>' --hostname=edgedevice1 --name iot-edge-device egilhansen/iothub-edge-device:1.5.0-amd64 --dns 8.8.8.8 --log-driver "json-file" --log-opt "max-file=10" --log-opt "max-size=200k"
-v /var/run/docker.sock:/var/run/docker.sock
This part is correct and this should mount the docker.sock, but in the docker-entrypoint.shexec /lib/systemd/systemd --log-level=info
When this fires off, it will reset /var/run/ and anything you had put in there will be removed. Docker then runs and creates a new docker.sock file so everything works.
The host and edge container dont see each others containers. Right now, when this edge container runs, it uses its nested docker instance causing it to pull images and create containers inside its own instance basically creating a massive layer where all your edge modules live. When you delete this edge container , you lose all the modules and images that it pulled.
If we can actually pass the docker.sock , then instead of creating the module containers under itself, it can create them as siblings instead of children. Images are shared with the host and both instances of docker see the same thing. If you update this container, all the other module containers will still persist.
I have tried moving the docker.sock into a different location and targeting that, but i get the issue from edge deamon