Recent

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

SaM1806

  • New member
  • *
  • Posts: 5
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: 10298
  • 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

  • New member
  • *
  • Posts: 5
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)?

ASBzone

  • Hero Member
  • *****
  • Posts: 633
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Win64 console app inside MS Nano Server container
« Reply #4 on: February 09, 2022, 02:41:25 am »
This console app runs fine on a Win64 machine (it shows the message) but it does nothing inside the Nano Server container.

Here is an interesting thread on this:  https://stackoverflow.com/questions/63688377/trying-to-port-application-to-docker-nanoserver-container-running-exe-fails-wit


Are you sure it is a 64-bit app?   Also, have you tried different FPC modes?
-ASB: https://www.BrainWaveCC.com/

OLD: Lazarus v2.0.13 r64843 / FPC v3.2.1-r49055
NEW: Lazarus v2_2_0-82-g6aebd4d4ae / FPC v3.2.3-587-g65733801e5
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

 

TinyPortal © 2005-2018