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

Bump Traefik to v2.2.3 #8329

Conversation

jbdoumenjou
Copy link
Contributor

Hello,

This PR updates Traefik to v2.2.3.

/cc @ldez @mmatur @SantoDE

Cheers

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link

github-actions bot commented Jul 9, 2020

Diff for a967a0c:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 78ea984..128297c 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,13 +1,13 @@
 Maintainers: Emile Vauge <[email protected]> (@emilevauge), Vincent Demeester <[email protected]> (@vdemeester), Ludovic Fernandez <[email protected]> (@ldez), Julien Salleyron <[email protected]> (@juliens), Nicolas Mengin <[email protected]> (@nmengin), Michael Matur <[email protected]> (@mmatur)
 GitRepo: https://github.com/containous/traefik-library-image.git
 
-Tags: v2.2.2, 2.2.2, v2.2, 2.2, chevrotin, latest
+Tags: v2.2.3, 2.2.3, v2.2, 2.2, chevrotin, latest
 Architectures: amd64, arm32v6, arm64v8
-GitCommit: 296caddf8ba97b52841872b2192758af9e9d7775
+GitCommit: afd07131364252ecf9c43a202f9f5151b0cb0bb9
 Directory: alpine
 
-Tags: v2.2.2-windowsservercore-1809, 2.2.2-windowsservercore-1809, v2.2-windowsservercore-1809, 2.2-windowsservercore-1809, chevrotin-windowsservercore-1809, windowsservercore-1809
+Tags: v2.2.3-windowsservercore-1809, 2.2.3-windowsservercore-1809, v2.2-windowsservercore-1809, 2.2-windowsservercore-1809, chevrotin-windowsservercore-1809, windowsservercore-1809
 Architectures: windows-amd64
-GitCommit: 296caddf8ba97b52841872b2192758af9e9d7775
+GitCommit: afd07131364252ecf9c43a202f9f5151b0cb0bb9
 Directory: windows/1809
 Constraints: windowsservercore-1809
diff --git a/_bashbrew-list b/_bashbrew-list
index 0272c2f..629578b 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -1,12 +1,12 @@
 traefik:2.2
 traefik:2.2-windowsservercore-1809
-traefik:2.2.2
-traefik:2.2.2-windowsservercore-1809
+traefik:2.2.3
+traefik:2.2.3-windowsservercore-1809
 traefik:chevrotin
 traefik:chevrotin-windowsservercore-1809
 traefik:latest
 traefik:v2.2
 traefik:v2.2-windowsservercore-1809
-traefik:v2.2.2
-traefik:v2.2.2-windowsservercore-1809
+traefik:v2.2.3
+traefik:v2.2.3-windowsservercore-1809
 traefik:windowsservercore-1809
diff --git a/traefik_latest/Dockerfile b/traefik_latest/Dockerfile
index 2c67462..bafb159 100644
--- a/traefik_latest/Dockerfile
+++ b/traefik_latest/Dockerfile
@@ -8,7 +8,7 @@ RUN set -ex; \
 		x86_64) arch='amd64' ;; \
 		*) echo >&2 "error: unsupported architecture: $apkArch"; exit 1 ;; \
 	esac; \
-	wget --quiet -O /tmp/traefik.tar.gz "https://github.com/containous/traefik/releases/download/v2.2.2/traefik_v2.2.2_linux_$arch.tar.gz"; \
+	wget --quiet -O /tmp/traefik.tar.gz "https://github.com/containous/traefik/releases/download/v2.2.3/traefik_v2.2.3_linux_$arch.tar.gz"; \
 	tar xzvf /tmp/traefik.tar.gz -C /usr/local/bin traefik; \
 	rm -f /tmp/traefik.tar.gz; \
 	chmod +x /usr/local/bin/traefik
@@ -22,5 +22,5 @@ LABEL org.opencontainers.image.vendor="Containous" \
 	org.opencontainers.image.url="https://traefik.io" \
 	org.opencontainers.image.title="Traefik" \
 	org.opencontainers.image.description="A modern reverse-proxy" \
-	org.opencontainers.image.version="v2.2.2" \
+	org.opencontainers.image.version="v2.2.3" \
 	org.opencontainers.image.documentation="https://docs.traefik.io"
diff --git a/traefik_windowsservercore-1809/Dockerfile b/traefik_windowsservercore-1809/Dockerfile
index 5929179..11398aa 100644
--- a/traefik_windowsservercore-1809/Dockerfile
+++ b/traefik_windowsservercore-1809/Dockerfile
@@ -3,12 +3,14 @@ FROM mcr.microsoft.com/windows/servercore:1809
 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
 
 RUN Invoke-WebRequest \
-        -Uri "https://github.com/containous/traefik/releases/download/v2.2.2/traefik_v2.2.2_windows_amd64.zip" \
+        -Uri "https://github.com/containous/traefik/releases/download/v2.2.3/traefik_v2.2.3_windows_amd64.zip" \
         -OutFile "/traefik.zip"; \
     Expand-Archive -Path "/traefik.zip" -DestinationPath "/" -Force; \
     Remove-Item "/traefik.zip" -Force
 
+COPY entrypoint.ps1 /
 EXPOSE 80
+ENTRYPOINT [ "powershell.exe", "/entrypoint.ps1" ]
 CMD ["/traefik"]
 
 # Metadata
@@ -16,5 +18,5 @@ LABEL org.opencontainers.image.vendor="Containous" \
     org.opencontainers.image.url="https://traefik.io" \
     org.opencontainers.image.title="Traefik" \
     org.opencontainers.image.description="A modern reverse-proxy" \
-    org.opencontainers.image.version="v2.2.2" \
+    org.opencontainers.image.version="v2.2.3" \
     org.opencontainers.image.documentation="https://docs.traefik.io"
diff --git a/traefik_windowsservercore-1809/entrypoint.ps1 b/traefik_windowsservercore-1809/entrypoint.ps1
new file mode 100644
index 0000000..a5f6207
--- /dev/null
+++ b/traefik_windowsservercore-1809/entrypoint.ps1
@@ -0,0 +1,19 @@
+if ($null -eq $args[0]) {
+    /traefik
+    exit $LASTEXITCODE 
+}
+
+if ($args[0].StartsWith("-")) {
+    /traefik $args
+    exit $LASTEXITCODE
+} 
+
+(/traefik $args[0] --help 2>&1>$null)
+
+if ($LASTEXITCODE -eq 0) {
+    /traefik $args
+    exit $LASTEXITCODE
+}
+
+Invoke-Expression "$args"
+exit $LASTEXITCODE
\ No newline at end of file

@yosifkit
Copy link
Member

yosifkit commented Jul 9, 2020

Regarding an entrypoint script in Windows containers.

The main issue we'll have with it (and truly the reason we don't have any entrypoint wrapper scripts on any Windows official images yet) is that Windows doesn't have the Unix concept of exec. With a Linux shell script entrypoint, we can end with exec, and once it invokes the intended command (postgres, mysqld, mongo, etc), the shell is gone completely, replaced by the target process.

- docker-library/postgres#506 (comment)

the notification in windowsservercore based images to affect all process running in the container

- moby/moby#25982 (comment)

What this means is that both the resident powershell and the traefik process get the signal to exit at the same time, so there is a race. One effect is that the exit $LASTEXITCODE usually doesn't happen and so the only exit code is the exit code of powershell itself (58 in our testing). Another effect is that output from traefik is lost if the powershell and container exit faster.

On one docker kill -sTERM, traefik even panicked (might be --tty/-t related, so we ran the others without):

$ docker run -it --rm --name test traefik:windowsservercore-1809
runtime: bad pointer in frame github.com/konsorten/go-windows-terminal-sequences.EnableVirtualTerminalProcessing at 0xc00064d680: 0x54 
fatal error: invalid pointer found on stack

runtime stack:
runtime.throw(0x29125ef, 0x1e)
        /usr/local/go/src/runtime/panic.go:1116 +0x79 fp=0x2a9ff7b8 sp=0x2a9ff788 pc=0x438729 
runtime.adjustpointers(0xc00064d680, 0x2a9ff8b8, 0x2a9ffc48, 0x3275720, 0x43bbf20)
        /usr/local/go/src/runtime/stack.go:599 +0x22e fp=0x2a9ff818 sp=0x2a9ff7b8 pc=0x44f66e 
runtime.adjustframe(0x2a9ffb58, 0x2a9ffc48, 0x43bbf20)
        /usr/local/go/src/runtime/stack.go:641 +0x355 fp=0x2a9ff8e8 sp=0x2a9ff818 pc=0x44f9d5
runtime.gentraceback(0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xc000648180, 0x0, 0x0, 0x7fffffff, 0x29f79c8, 0x2a9ffc48, 0x0, ...) 
        /usr/local/go/src/runtime/traceback.go:334 +0x111c fp=0x2a9ffbc0 sp=0x2a9ff8e8 pc=0x45e3bc
runtime.copystack(0xc000648180, 0x4000)
        /usr/local/go/src/runtime/stack.go:888 +0x298 fp=0x2a9ffd78 sp=0x2a9ffbc0 pc=0x4500f8
runtime.newstack()
        /usr/local/go/src/runtime/stack.go:1043 +0x219 fp=0x2a9fff08 sp=0x2a9ffd78 pc=0x4503c9
runtime.morestack()
        /usr/local/go/src/runtime/asm_amd64.s:449 +0x97 fp=0x2a9fff10 sp=0x2a9fff08 pc=0x467a57

goroutine 33 [copystack]:
runtime.concatstring2(0xc00064d3b0, 0x28e0d9b, 0xc, 0x28d0411, 0x1, 0x10, 0x0)
        /usr/local/go/src/runtime/string.go:57 +0x71 fp=0xc00064d378 sp=0xc00064d370 pc=0x451e91
syscall.UTF16FromString(0x28e0d9b, 0xc, 0x0, 0x0, 0x13400000007, 0x0, 0xc000048ec0)
        /usr/local/go/src/syscall/syscall_windows.go:45 +0xcc fp=0xc00064d460 sp=0xc00064d378 pc=0x48019c
syscall.UTF16PtrFromString(...)
        /usr/local/go/src/syscall/syscall_windows.go:91
syscall.LoadDLL(0x28e0d9b, 0xc, 0xc000263558, 0x4426c3, 0xc000648180)
        /usr/local/go/src/syscall/dll_windows.go:69 +0x54 fp=0xc00064d518 sp=0xc00064d460 pc=0x47a9b4
syscall.(*LazyDLL).Load(0xc000004660, 0x0, 0x0)
        /usr/local/go/src/syscall/dll_windows.go:236 +0xc7 fp=0xc00064d568 sp=0xc00064d518 pc=0x47c7c7
syscall.(*LazyProc).Find(0xc000123ef0, 0x0, 0x0)
        /usr/local/go/src/syscall/dll_windows.go:291 +0xbe fp=0xc00064d5c0 sp=0xc00064d568 pc=0x47cabe
syscall.(*LazyProc).mustFind(0xc000123ef0)
        /usr/local/go/src/syscall/dll_windows.go:309 +0x32 fp=0xc00064d5e8 sp=0xc00064d5c0 pc=0x47cbe2
syscall.(*LazyProc).Call(0xc000123ef0, 0xc0003f9f90, 0x2, 0x2, 0x29f7d40, 0xc0002636b8, 0x486ba6, 0x7ff915022a90)
        /usr/local/go/src/syscall/dll_windows.go:327 +0x36 fp=0xc00064d638 sp=0xc00064d5e8 pc=0x47ccb6
github.com/konsorten/go-windows-terminal-sequences.EnableVirtualTerminalProcessing(0x54, 0x1, 0x0, 0xc0002636ec)
        /go/pkg/mod/github.com/konsorten/[email protected]/sequences.go:30 +0xcb fp=0xc00064d698 sp=0xc00064d638 pc=0x77b7ab 
github.com/sirupsen/logrus.initTerminal(0x2dedb40, 0xc000006018)
        /go/pkg/mod/github.com/sirupsen/[email protected]/terminal_check_windows.go:16 +0x64 fp=0xc00064d6c8 sp=0xc00064d698 pc=0x782524
github.com/sirupsen/logrus.checkIfTerminal(0x2dedb40, 0xc000006018, 0x160108)
        /go/pkg/mod/github.com/sirupsen/[email protected]/terminal_check_windows.go:31 +0xb4 fp=0xc00064d700 sp=0xc00064d6c8 pc=0x782604
github.com/sirupsen/logrus.(*TextFormatter).init(...)
        /go/pkg/mod/github.com/sirupsen/[email protected]/text_formatter.go:86
github.com/sirupsen/logrus.(*TextFormatter).Format.func1()
        /go/pkg/mod/github.com/sirupsen/[email protected]/text_formatter.go:170 +0x58 fp=0xc00064d730 sp=0xc00064d700 pc=0x785df8
sync.(*Once).doSlow(0xc00009c4f0, 0xc000263960)
        /usr/local/go/src/sync/once.go:66 +0xf3 fp=0xc00064d780 sp=0xc00064d730 pc=0x4787f3
sync.(*Once).Do(...)
        /usr/local/go/src/sync/once.go:57
github.com/sirupsen/logrus.(*TextFormatter).Format(0xc00009c4b0, 0xc00056ccb0, 0xc000263d38, 0x785c94, 0x25e1940, 0xc00020c120, 0xc000263d80) 
        /go/pkg/mod/github.com/sirupsen/[email protected]/text_formatter.go:170 +0xf1d fp=0xc00064dd08 sp=0xc00064d780 pc=0x7836dd
github.com/sirupsen/logrus.(*Entry).write(0xc00056ccb0)
        /go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:255 +0x83 fp=0xc00064dd90 sp=0xc00064dd08 pc=0x77d063 
github.com/sirupsen/logrus.Entry.log(0xc000168000, 0xc000215fb0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)        
        /go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:231 +0x1a5 fp=0xc00064de08 sp=0xc00064dd90 pc=0x77cd05 
github.com/sirupsen/logrus.(*Entry).Log(0xc00056cfc0, 0x2, 0xc00023a680, 0x1, 0x1)
        /go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:268 +0xf2 fp=0xc00064df10 sp=0xc00064de08 pc=0x77d2f2
github.com/sirupsen/logrus.(*Entry).Error(0xc00056cfc0, 0xc00023a680, 0x1, 0x1)
        /go/pkg/mod/github.com/sirupsen/[email protected]/entry.go:297 +0x58 fp=0xc00064df48 sp=0xc00064df10 pc=0x77d608 
github.com/containous/traefik/v2/pkg/server.(*TCPEntryPoint).Start(0xc000644500, 0x2e52320, 0xc0000e0030)
        /go/src/github.com/containous/traefik/pkg/server/server_entrypoint_tcp.go:168 +0x169 fp=0xc00064dfc8 sp=0xc00064df48 pc=0x20fa079
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00064dfd0 sp=0xc00064dfc8 pc=0x469a81
created by github.com/containous/traefik/v2/pkg/server.TCPEntryPoints.Start
        /go/src/github.com/containous/traefik/pkg/server/server_entrypoint_tcp.go:81 +0x143

goroutine 1 [chan receive]:
runtime.gopark(0x29f7a38, 0xc00019e2f8, 0x170e, 0x2)
        /usr/local/go/src/runtime/proc.go:304 +0xf5 fp=0xc00069fba8 sp=0xc00069fb88 pc=0x43b195 
runtime.chanrecv(0xc00019e2a0, 0x0, 0x1, 0x0)
        /usr/local/go/src/runtime/chan.go:525 +0x2f5 fp=0xc00069fc38 sp=0xc00069fba8 pc=0x4062f5
runtime.chanrecv1(0xc00019e2a0, 0x0)
        /usr/local/go/src/runtime/chan.go:407 +0x2b fp=0xc00069fc68 sp=0xc00069fc38 pc=0x405fab
github.com/containous/traefik/v2/pkg/server.(*Server).Wait(...)
        /go/src/github.com/containous/traefik/pkg/server/server.go:69 
main.runCmd(0xc00056ccb0, 0x0, 0x0)
        /go/src/github.com/containous/traefik/cmd/traefik/traefik.go:159 +0x560 fp=0xc00069fd88 sp=0xc00069fc68 pc=0x2103840
main.main.func1(0xc0000521f0, 0x0, 0x0, 0x0, 0xc00017e380)
        /go/src/github.com/containous/traefik/cmd/traefik/traefik.go:55 +0x33 fp=0xc00069fdb0 sp=0xc00069fd88 pc=0x2107793
github.com/containous/traefik/v2/pkg/cli.run(0xc00017e380, 0xc0000521f0, 0x0, 0x0, 0x8, 0xc000554430) 
        /go/src/github.com/containous/traefik/pkg/cli/commands.go:133 +0x173 fp=0xc00069fe28 sp=0xc00069fdb0 pc=0x1ff1ce3
github.com/containous/traefik/v2/pkg/cli.execute(0xc00017e380, 0xc0000521f0, 0x1, 0x1, 0x447a01, 0x439f2a0, 0xc000067f78)
        /go/src/github.com/containous/traefik/pkg/cli/commands.go:57 +0x8f1 fp=0xc00069ff00 sp=0xc00069fe28 pc=0x1ff1a11
github.com/containous/traefik/v2/pkg/cli.Execute(...)
        /go/src/github.com/containous/traefik/pkg/cli/commands.go:51 
main.main()
        /go/src/github.com/containous/traefik/cmd/traefik/traefik.go:71 +0x3f9 fp=0xc00069ff88 sp=0xc00069ff00 pc=0x2103159
runtime.main()
        /usr/local/go/src/runtime/proc.go:203 +0x1fa fp=0xc00069ffe0 sp=0xc00069ff88 pc=0x43adda
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00069ffe8 sp=0xc00069ffe0 pc=0x469a81 

goroutine 2 [force gc (idle)]:
runtime.gopark(0x29f7c58, 0x47bd0c0, 0x1411, 0x1)
        /usr/local/go/src/runtime/proc.go:304 +0xf5 fp=0xc000063fb0 sp=0xc000063f90 pc=0x43b195
runtime.goparkunlock(...)
        /usr/local/go/src/runtime/proc.go:310
runtime.forcegchelper()
        /usr/local/go/src/runtime/proc.go:253 +0xc5 fp=0xc000063fe0 sp=0xc000063fb0 pc=0x43b035 
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000063fe8 sp=0xc000063fe0 pc=0x469a81
created by runtime.init.6
        /usr/local/go/src/runtime/proc.go:242 +0x3c
$ echo $?
235

@ldez
Copy link
Contributor

ldez commented Jul 10, 2020

Hello, we added this script because of the change of the validation process of the windows based official image.

Those changes force us to remove Traefik v1 from the manifest (#8322) and to add this script.

We are not Windows and PowerShell specialists, but we have to keep a consistent behavior to don't break our user infrastructure.

Do you have a suggestion to follow your new validation rules and don't break our current behavior?

@tianon
Copy link
Member

tianon commented Jul 10, 2020

I'd suggest we add the following in test/config.sh around line 310:

# https://github.com/docker-library/official-images/pull/8329#issuecomment-656383836
	[traefik:windowsservercore_override-cmd]=1

ala:

...
	[nats-streaming:windowsservercore_override-cmd]=1

# https://github.com/docker-library/official-images/pull/8329#issuecomment-656383836
	[traefik:windowsservercore_override-cmd]=1

	# TODO adjust MongoDB tests to use docker networks instead of links so they can work on Windows (and consider using PowerShell to generate appropriate certificates for TLS tests instead of openssl)
	[mongo:windowsservercore_mongo-basics]=1
...

(Then, revert to ENTRYPOINT ["traefik"] as before.)

@ldez
Copy link
Contributor

ldez commented Jul 10, 2020

Thank you for the suggestion 👍

I will have to open another PR because I don't have write access to my colleague fork and it's 2:30am for us, I can not wake up my colleague.

I will edit test/config.sh and update our Dockerfile, and create a new PR.

@ldez ldez mentioned this pull request Jul 10, 2020
@ldez
Copy link
Contributor

ldez commented Jul 10, 2020

the new PR is #8333

@jbdoumenjou jbdoumenjou deleted the traefik-new-version-afd07131364252ecf9c43a202f9f5151b0cb0bb9 branch July 10, 2020 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants