Recent

Author Topic: Win64 console app inside MS Nano Server container  (Read 3448 times)

SaM1806

  • Newbie
  • Posts: 2
Win64 console app inside MS Nano Server container
« on: October 20, 2021, 07:29:05 pm »
I built a small Hello World console app(1) targeting the Win64 platform(2) and put it inside a MS Nano Server container(3).

This console app runs fine on a Win64 machine (it shows the message) but it does nothing inside the Nano Server container.

I built another Win64 Hello Word app using gcc on Linux and it ran as expected (it shows the message) inside the MS Nano Server container.

What I am missing here?

(1) The code:

program hello;
begin
  Writeln('Hello world!');
end.


(2) I tried to build the app both from Linux and Windows. The results were the same: app runs on Win64 machine but does nothing inside the container.

(3) I built the container using this Dockerfile:

FROM mcr.microsoft.com/windows/nanoserver:2004
COPY hello.exe .
CMD hello


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9706
  • FPC developer.
Re: Win64 console app inside MS Nano Server container
« Reply #1 on: October 23, 2021, 11:23:07 pm »
Maybe the win64 target  has a too large stacksize by default for the nano container?

Finding out what are the differences in specs between nano and full win64 would be the next step.

SaM1806

  • Newbie
  • Posts: 2
Re: Win64 console app inside MS Nano Server container
« Reply #2 on: October 26, 2021, 11:45:46 pm »
Quote
Maybe the win64 target  has a too large stacksize by default for the nano container?

I tried smaller stacksize and heapsize values, same results.

My use case: I have some legacy Delphi Win32 (console) apps that I would like to run inside containers.

My initial idea was recompile those apps with FPC targeting Win64 and run them inside nano server containers.

The quick fix is to use a server core as the base image of the container. The server core container supports Win32 so I can run my legacy apps without recompilation. Unfortunally, the server core image is about 20 times bigger than the nano server image.

Quote
Finding out what are the differences in specs between nano and full win64 would be the next step.

I will look into this.

Thanks!


Menant Didier

  • Newbie
  • Posts: 1
Re: Win64 console app inside MS Nano Server container
« Reply #3 on: November 19, 2021, 05:48:41 pm »
Hello
We have the same Pb with delphi RAD 10.4 (paying  :'(  )
I did the same test with a hello console, compile in 64 result nothing !!
 
Why Microsoft reserves this OS ?
it's interesting for me to make the cloud light and efficient cloud.
It's really unbelievable
I think you have to load roles (IIS, File, etc.) to get to run with the minimum to operate with pascal code.

Did you advance on the PB and find an minimum image nanoserver for pascal (not servercore it works)?

 

TinyPortal © 2005-2018