Watchtower: Add windows support

Created on 19 Oct 2017  路  15Comments  路  Source: containrrr/watchtower

Any plans to support windows?

Most helpful comment

@miking-the-viking
The windows binary is available in the Release Assets.
https://github.com/containrrr/watchtower/releases/download/v1.0.3/watchtower_windows_amd64.zip

All 15 comments

I would be very interested in this too.

What changes would need to be made?

Should be pretty easy to cross compile watchtower for windows.

Windows binaries will be released with v0.2.0. It would be great if you could test it, once it has been released.

Unfortunately I have no experience with windows docker. If anyone could contribute the Dockerfile for a windows image, that would be awesome.

After building watchtower on Windows 10 and running it, I'm getting:
FATA[0000] error during connect: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json?limit=0: dial tcp: lookup /var/run/docker.sock: no such host
Bummer, I was hoping that I can create a windows based image for watchtower.

Default settings of watchtower are specific for linux systems, you need to specify the remote host using a tcp socket, see remote hosts.

@stffabi Thanks, I got it to work as a standalone app. watchtower will connect to the docker's named pipe npipe:////./pipe/docker_engine on windows. Docker now supports mounting named pipes on windows. Technically, the container can connect to the docker host if we pass -v \.\pipe\docker_engine:\.\pipe\docker_engine
There seems to be an issue with the mounting part and I'm unable to see the pipe. If this gets resolved, I think I can share a Dockerfile for a windows based image :)

@ralsu091 can you share what you have so far?

@IvanJosipovic Sure, if you grab the exe you can run it with:
watchtower.exe -h npipe:////./pipe/docker_engine

a Dockerfile would look like:

FROM microsoft/windowservercore

COPY "watchtower.exe" /

ENTRYPOINT ["watchtower.exe"]

to run the image in a container:

docker run -d \
  --name watchtower \
  -e DOCKER_HOST=npipe:////./pipe/docker_engine
  -v \\.\pipe\docker_engine:\\.\pipe\docker_engine
  imageName

I'm still unable to mount the named pipe in windows, even though it should just work:https://github.com/moby/moby/issues/36562

Let me know if you were able to get it to work :)

Tried today the above attempt (but with mcr.microsoft.com/windows/nanoserver:1809) and it still does not work... will try run watchtower on linux MobyVM and the windows containers as native ones.

Also, it's an option to simply run watchtower as standalone executable for now...

I realized I need to stick on ltsc2016 windows server, so I dropped the idea of running it on linux. To workaround this issue with the container I did:

  • Build Watchtower.exe
  • Install chocolatey (Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')));
  • Install nssm (choco install nssm -y);
  • Then run this set of commands (replace the paths and arguments with your own):
nssm.exe install Watchtower C:\Datacenter\watchtower.exe
nssm.exe set Watchtower AppParameters ^"-H npipe:////./pipe/docker_engine -s ^\^"* 18 * * 1-5^\^"^"
nssm.exe set Watchtower AppDirectory C:\Datacenter
nssm.exe set Watchtower AppExit Default Restart
nssm.exe set Watchtower AppStdout C:\Datacenter\watchtower.log
nssm.exe set Watchtower AppStderr C:\Datacenter\watchtower.log
nssm.exe set Watchtower Description "Container auto updater (Watchtower)"
nssm.exe set Watchtower DisplayName Watchtower
nssm.exe set Watchtower ObjectName LocalSystem
nssm.exe set Watchtower Start SERVICE_AUTO_START
nssm.exe set Watchtower Type SERVICE_WIN32_OWN_PROCESS

if you want to go through a guided installation, simply type nssm install Watchtower

@EriksonBahr out of curiosity, where were you able to find a watchtower.exe? I'm trying to setup watchtower on a Windows Server 2019 for Linux containers and am running into rampant issues trying to get the socket mounted.

@EriksonBahr out of curiosity, where were you able to find a watchtower.exe? I'm trying to setup watchtower on a Windows Server 2019 for Linux containers and am running into rampant issues trying to get the socket mounted.

He likely built it himself from source. Clone the repo and run go build -o watchtower.exe . on a windows host, or prefix it with GOOS=windows if you're cross-compiling.

@miking-the-viking
The windows binary is available in the Release Assets.
https://github.com/containrrr/watchtower/releases/download/v1.0.3/watchtower_windows_amd64.zip

@miking-the-viking
The windows binary is available in the Release Assets.
v1.0.3 watchtower_windows_amd64.zip (download)

Probably handled by goreleaser :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

darox picture darox  路  5Comments

simskij picture simskij  路  5Comments

alexhaller picture alexhaller  路  3Comments

kiprasmel picture kiprasmel  路  5Comments

ag0r4n picture ag0r4n  路  4Comments