Expected behavior
Having LibreOffice running in headless mode on Windows Server Core, be able to connect to that “service” from other containers in the same composition or even from the same container (Test-NetConnection -ComputerName localhost -Port 8101)
Actual behavior
Error connection to LibreOffice headless from other containers in the same composition and from the same container with the Powershell command Test-NetConnection.
Information
This is the Dockerfile used to generate the Headless Libreoffice Docker image
FROM microsoft/windowsservercore
MAINTAINER Gabriel Munoz
LABEL Description=“LibreOffice” Vendor=“The Document Foundation” Version=“5.4.2”
ENV LIBREOFFICE_VERSION 5.4.2
ENV LIBREOFFICE_URL https://download.documentfoundation.org/libreoffice/stable/${LIBREOFFICE_VERSION}/win/x86_64/LibreOffice_${LIBREOFFICE_VERSION}_Win_x64.msi
RUN mkdir C:\LibreOffice
WORKDIR /LibreOffice
RUN powershell -Command
$ErrorActionPreference = ‘Stop’; \
Invoke-WebRequest -Method Get -Uri %LIBREOFFICE_URL% -OutFile c:\LibreOffice.msi ;
Start-Process c:\LibreOffice.msi -ArgumentList ‘/qr /msoreg=0 ADDLOCAL=ALL CREATEDESKTOPLINKE=0 REGISTER_ALL_SMO_TYPES=1 REGISTER_DOC=1 INSTALLLOCATION=c:\LibreOffice REMOVE=gm_o_Onlineupdate,gm_p_Base,gm_p_Base_Bin,gm_o_Xsltfiltersamples RebootYesNo=No’ -Wait ; \
Remove-Item c:\LibreOffice.msi -Force
EXPOSE 8101
CMD “C:\LibreOffice\program\soffice.exe --headless --accept=‘socket,host=0.0.0.0,port=8101;urp;’ --nofirststartwizard”
Steps to reproduce the behavior
- Generate the docker image using the provided Dockerfile
- Run a container based on that image
- Enter into the container (docker exec -t -i powershell)
- See with the ps command that LibreOffice is running
- Execute Test-NetConnection -ComputerName localhost -Port 8101
- The command fails to connect using that port
- You also get the same error using Test-NetConnection from other container in the same docker-compose file.