A firewall is blocking sharing between Windows and the containers – Docker
I recently encountered this error while trying to run one of my docker setups.
ERROR: for mediawiki-docker-dev_db-slave_1 Cannot start service db-slave: b'OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"/tmp/mwdd/entrypoint.sh\": stat /tmp/mwdd/entrypoint.sh: no such file or directory": unknown'
I have encountered errors like this before and it has always ended up being related to docker and sharing my drives to the linux VM that actually runs my containers.
Checking the shared drives menu of the docker UI everything seemed to be fine.
However when removing the drive share and re sharing the drive I got an error message saying that there was a “Firewall detected” and that “A firewall is blocking file Sharing between Windows and the containers. See documentation for more info”.
The docs seem to suggest that my firewall rule had vanished somehow. I spent a few minutes digging around and tinkering with firewall rules before determining the rule itself was not the issue. The next suggestion was to “reinstall the File and Print sharing service on the Hyper-V virtual network card “
Opening PowerShell as administrator and running the commands suggested on stackoverflow (switching the DockerNAT network) seemed to do the trick.
Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -NetworkCategory Private
I still have no idea why this happened. Did I accidently set the DockerNAT network to be public? Could the Docker UI really not check the firewall rule itself and propose the fix?