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

Trouble running in a docker windows container #177

Open
Seikilos opened this issue Dec 13, 2020 · 3 comments
Open

Trouble running in a docker windows container #177

Seikilos opened this issue Dec 13, 2020 · 3 comments

Comments

@Seikilos
Copy link

Seikilos commented Dec 13, 2020

I've seen your docker file but it was using core 2.1 while your projects are on 3.1 already so it seems out of date.

Beside this I wrote a small docker file for running it in dockers windows mode

FROM mcr.microsoft.com/windows/servercore:ltsc2019
LABEL Description="Papercut SMTP"
RUN powershell -Command \
	$ErrorActionPreference = 'Stop'; \
	[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
	Invoke-WebRequest -Method Get -Uri https://github.com/ChangemakerStudios/Papercut-SMTP/releases/download/5.7.0/PapercutService.5.7.0.zip -OutFile c:\papercut.zip ; \
	Expand-Archive -Path c:\papercut.zip -DestinationPath c:\papercut ; \
	Remove-Item c:\papercut.zip -Force

ADD Papercut.Service.Settings.json /papercut 

EXPOSE 25 37408

CMD /papercut/Papercut.Service.exe

When I run it via docker run -d -p 25:25/tcp -p 37408:37408/tcp --name papercut papercut the container starts and the output says everything is fine, web ui is listening to localhost:37408 but accessing it from my host via http://localhost:37408 always times out, same for http://127.0.0.1:37408

I suspect that the Papercut.Service.Settings.json I use is wrong but I tried HttpBaseAddress to be localhost and 127.0.0.1 without luck. Also IP is set to Any or 0.0.0.0 but it seems to be impossible to connect to this container.

Is this a bug like the listener is not pointing to all interfaces or something similar? A hint would be appreciated 👍 😄

Edit: After I changed the HttpBaseAddress to http://localhost. Accessing the address immediately brings a

Forbidden URL

HTTP Error 403. The request URL is forbidden.

Now I don't actually know what forbidden is in this context? Google might point to SSL issues, but I am not using SSL here. Is there a log or something for this? The standard log file in "Logs" does not contain anything helpful

@Jaben
Copy link
Member

Jaben commented Dec 25, 2020

Did you try binding to 0.0.0.0 instead of localhost?

@Seikilos
Copy link
Author

@Jaben could you explain which configuration to set to 0.0.0.0? HttpBaseAddress cannot be set to http://0.0.0.0 since papercut fails to bind in this case. IP is set to Any but as I mentioned I already tried setting it to 0.0.0.0, same effect (also Any==0.0.0.0, AFAIK)
I am quite sure that I am missing something here :)

@Jaben
Copy link
Member

Jaben commented Dec 24, 2021

Pretty sure PR #202 (just merged) fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants