I'm building a Docker image based on Windows servercore, but I need to be able to either reboot it after building, to let some changes be applied, or change the size of pagefile.sys without rebooting.
The reason for this is that I have some applications that because of legacy issues, they fail if they don't have enough page file memory available. I have not been able to increase the page file size on my servercore container, because I can't do reboot after running the command line parameters required to make it work.
For reference, these are the commands I run, but they require a reboot after using them to make them actually do the changes and create the new pagefile.sys with the size I want:
RUN mkdir C:\SWAPS
RUN wmic pagefileset create name="C:\SWAPS\pagefile.sys"
RUN wmic pagefileset where name="C:\\SWAPS\\pagefile.sys" set InitialSize=128000,MaximumSize=256000
RUN wmic pagefileset where name="C:\\pagefile.sys" delete
This is the base image I'm using: https://hub.docker.com/_/microsoft-windows-servercore