Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase Docker API version to work with Windows Containers #1094

Closed
StefanScherer opened this issue Feb 1, 2017 · 4 comments · Fixed by #1113
Closed

Increase Docker API version to work with Windows Containers #1094

StefanScherer opened this issue Feb 1, 2017 · 4 comments · Fixed by #1113

Comments

@StefanScherer
Copy link
Contributor

StefanScherer commented Feb 1, 2017

What version of Traefik are you using (traefik version)?

Version:      v1.1.2
Codename:     camembert
Go version:   go1.7.4
Built:        2016-12-15_10:27:40AM
OS/Arch:      windows/amd64

What is your environment & configuration (arguments, toml...)?

  • Dockerfile:
FROM microsoft/nanoserver

ADD https://github.com/containous/traefik/releases/download/v1.1.2/traefik_windows-amd64 /traefik.exe

VOLUME C:/etc/traefik
VOLUME C:/etc/ssl
RUN powershell -command \
    set-itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices' -Name 'T:' -Value '\??\C:\etc\traefik' -Type String ; \
    set-itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices' -Name 'S:' -Value '\??\C:\etc\ssl' -Type String

EXPOSE 80
ENTRYPOINT ["/traefik", "--configfile=T:/traefik.toml"]

# Metadata
LABEL org.label-schema.vendor="Containous" \
      org.label-schema.url="https://traefik.io" \
      org.label-schema.name="Traefik" \
      org.label-schema.description="A modern reverse-proxy" \
      org.label-schema.version="v1.1.2" \
      org.label-schema.docker.schema-version="1.0"
  • traefik.toml:
################################################################
# Web configuration backend
################################################################
[web]
address = ":8080"
################################################################
# Docker configuration backend
################################################################
[docker]
domain = "docker.local"
watch = true
# Use Swarm Mode services as data provider
#
# Optional
# Default: false
#
#swarmmode = true

################################################################
# Enable docker TLS connection
# use -v path-on-host-to-tls-certs:C:\etc\ssl and the certs
# will appear in drive S:
################################################################
[docker.tls]
ca = "S:/ca.pem"
cert = "S:/cert.pem"
key = "S:/key.pem"

What did you do?

Run Traefik inside a Windows Nanoserver container to communicate with a Windows Docker engine

docker build -t traefik .
docker run -it -v C:$(pwd):C:/etc/traefik -v C:/Users/vagrant/.docker:C:/etc/ssl -p 8080:8080 -p 80:80 traefik --docker.endpoint=tcp://172.31.80.1:2376 --loglevel=DEBUG

What did you expect to see?

Traefik should connect to the Windows Docker engine 1.13.0 which forces minimum API version 1.24.

time="2017-02-01T13:45:04-08:00" level=debug msg="Docker connection established with docker 1.13.1-rc1 (API 1.25)" 

What did you see instead?

time="2017-02-01T13:44:31-08:00" level=error msg="Failed to list containers for docker, error Error response from daemon: client version 1.21 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version" 

I did a proof of concept which works by patching provider/docker.go to use API version 1.24. Should I send this change as PR? I don't know if that would be fine on Linux as Traefik would no longer work with older Docker engines.

You can find my test setup for Windows at https://github.com/StefanScherer/dockerfiles-windows/tree/master/traefik

@StefanScherer
Copy link
Contributor Author

Another issue regarding running Traefik in Windows containers is that #1009 does not work on Windows. There is no "600" file permission, so I had to comment out that while testing with master branch.

@emilevauge
Copy link
Member

emilevauge commented Feb 1, 2017

@StefanScherer thanks for giving some feedback.
@vdemeester is there any issue to go with Docker API v1.24 (compatibility with Docker 1.10) ?

@vdemeester
Copy link
Contributor

@emilevauge @StefanScherer I'm ok dropping support for 1.9 and lower ; but we could also have a api version number different depending on the architecture, @containous/traefik wdyt ?

@prochnowc
Copy link

@emilevauge This is also an issue when running traefik for linux on docker for windows (with experimental LCOW support).

@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants