Enable integration testing on Windows.
This depends on the windows instance being able to run Docker.
Windows instance can now run Docker - this can proceed.
@chanseokoh feel free to take over #745 - I was trying to get it working there
Does anyone know how to restart the docker daemon on the Kokoro Windows machine? I'm trying to reload daemon.json config. I tried Net stop com.docker.service and Net start com.docker.service, and although they seem to work, I'm having trouble making it reload the config.
The Docker Daemon page notes:
CONFIGURATION RELOAD BEHAVIOR
Some options can be reconfigured when the daemon is running without requiring to restart the process. We use the SIGHUP signal in Linux to reload, and a global event in Windows with the key Global\docker-daemon-config-$PID.
At first net start/stop com.docker.service seemed to work but doesn't really look like, and now I'm trying sc start/stop com.docker.service as told by the Kokoro folks. However, sc is asynchronous, so still digging into it.
Just an update:
I think net start/stop and sc start/stop are effectively same except that sc simply makes a request and does not block. Although sc stop does stop the Docker service and I can verify its STOPPED state, I can still do docker images or docker pull, so I think either it's not really stopping the daemon or there is another daemon running. Waiting for the Kokoro folks for an answer.
BTW, the reason I'm doing this is to enable experimental features of the Docker daemon so that I can pass the --platform linux flag.
Update:
On the Kokoro Windows machine, tasklist showed there were two processes com.docker.service and dockerd.exe running. I believe net|sc start|stop is supposed to work, but in reality, it only started/stopped com.docker.service and had no effect on dockerd.exe at all.
So I ended up doing below to turn on the experimental features of the Docker daemon:
- Manually kill
dockerd.exe:Taskkill /IM dockerd.exe /F - Update
%ProgramData%\Docker\config\daemon.jsonto flip the value ofexperimental- Passing
--experimentalwhen startingdockerdwon't work; it will complain you can't set it with bothdaemon.jsonand the flag.
{ "registry-mirrors":[], "insecure-registries":[], "experimental":true, "hosts":["tcp://0.0.0.0:2375","npipe://"] } - Passing
- Update
%PATH%so that I can rundockerd.exe. (For some unknown reason on Kokoro, I can't access the binary directly.)set PATH=%ProgramFiles%\Docker\Docker\resources;%JAVA_HOME%\bin;%PATH% - Manually start the Docker daemon:
CMD /C START dockerd.
However, unfortunately, passing --platform linux to Docker did not work on Kokoro, returning the error invalid Platform OS "linux". Haven't looked into why in detail, but it appears that Linux Containers for Windows (LCOW) is not supported by the Windows OS in the Kokoro machine: https://github.com/docker/for-win/issues/2241#issuecomment-408444877 Seems like another dead end.