x y x y - 3 months ago 30
PowerShell Question

How to install Tomcat in Docker Windows Server Container?

On my windows server 2016 tp5 virtual machine, I would like to create a simple native windows based docker example without virtualbox.

The example needs tomcat for windows and since this windows server 2016 docker container uses a shared windows kernel, installing tomcat should be straight forward, alas! Using the following powershell docker build command stops with non-zero code: 255

Dockerfile in

c:\build
:

FROM microsoft/windowsservercore
RUN powershell -Command wget -Uri mirror.klaus-uwe.me/apache/tomcat/tomcat-7/v7.0.70/bin/apache-tomcat-7.0.70-windows-x64.zip -OutFile "$env:TEMP\tomcat-7.0.70.zip"


Admin-powershell:

docker build c:\build


Result:

---> Running in 317a3572890e
The command 'cmd /S /C powershell -Command wget -Uri mirror.klaus-uwe.me/apache/tomcat/tomcat-7/v7.0.70/bin/apache-tomca
t-7.0.70-windows-x64.zip -OutFile "$env:TEMP\tomcat-7.0.70.zip"' returned a non-zero code: 255


Although the zip file has been downloaded in my users temp dir.

Can anybody tell me, how a native windows tomcat installation should look like, as I am not really deep in this stuff.

Answer

As mentioned here:

The error code "255" usually means that it is not able to find the file you are asking it to execute

So try and test with the full path and name of the binary(ies) involved in your RUN command line (like powershell)

But test also a simpler case:

RUN dir c:\Users\

This has been recently reported as failing with the same exit code 255, which would mean the latest docker on Windows Server 2016 Technical Preview 5 has a bug.