microsoft / nav-docker

Official Microsoft repository for Dynamics NAV in Docker resources. It has not been decided yet, to which extend Microsoft will ship Docker images with NAV, so everything in this repo is work in progress and might be subject to deletion.
MIT License
180 stars 91 forks source link

Folders feature doesn't work for Base Images v1.0.2.6+ #512

Closed lippertmarkus closed 5 months ago

lippertmarkus commented 2 years ago

Base Image version v1.0.2.5 works

Build

New-BcImage -artifactUrl (Get-BCArtifactUrl -version 19.3 -storageAccount bcartifacts -type OnPrem -country at) -includeTestToolkit -includePerformanceToolkit -imageName old -licenseFile "<license>" -baseImage "mcr.microsoft.com/businesscentral:10.0.20348.707-1.0.2.5"

Run

docker run --rm -m 10GB -e "folders=c:\run=https://ppishare.blob.core.windows.net/test/dev_main.zip?sp=r&st=2022-05-31T06:56:50Z&se=2022-06-30T14:56:50Z&spr=https&sv=2020-08-04&sr=b&sig=u8Hypb7m4No207Iyg6Ra3oMCIlRUJxZlsSaCRE53eQI%3D" -e accept_eula=y -e accept_outdated=y old:onprem-19.3.34541.35002-at
Setting up folders...
Downloading https://ppishare.blob.core.windows.net/test/dev_main.zip?sp=r&st=2022-05-31T06:56:50Z&se=2022-06-30T14:56:50Z&spr=https&sv=2020-08-04&sr=b&sig=u8Hypb7m4No207Iyg6Ra3oMCIlRUJxZlsSaCRE53eQI%3D to c:\run
Extracting file in temp folder
Moving all extracted files to target folder c:\run
+Setting up folders took 2 seconds
This seems to be a regular service start
Initializing...
Starting Container
...

Base Image version v1.0.2.7 doesn't work

Build

New-BcImage -artifactUrl (Get-BCArtifactUrl -version 19.3 -storageAccount bcartifacts -type OnPrem -country at) -includeTestToolkit -includePerformanceToolkit -imageName new -licenseFile "<license>" -baseImage "mcr.microsoft.com/businesscentral:10.0.20348.707-1.0.2.7"

Run

docker run --rm -m 10GB -e "folders=c:\run=https://ppishare.blob.core.windows.net/test/dev_main.zip?sp=r&st=2022-05-31T06:56:50Z&se=2022-06-30T14:56:50Z&spr=https&sv=2020-08-04&sr=b&sig=u8Hypb7m4No207Iyg6Ra3oMCIlRUJxZlsSaCRE53eQI%3D" -e accept_eula=y -e accept_outdated=y new:onprem-19.3.34541.35002-at
Setting up folders...
Downloading https://ppishare.blob.core.windows.net/test/dev_main.zip?sp=r&st=2022-05-31T06:56:50Z&se=2022-06-30T14:56:50Z&spr=https&sv=2020-08-04&sr=b&sig=u8Hypb7m4No207Iyg6Ra3oMCIlRUJxZlsSaCRE53eQI%3D to c:\run
Extracting file in temp folder
Moving all extracted files to target folder c:\run
-Cannot create a file when that file already exists.

BcContainerHelper version 3.0.10

lippertmarkus commented 2 years ago

@freddydk any feedback on this?

freddydk commented 2 years ago

Sorry, didn't see this before going on vacation - will have a look at this.

NAVRockClimber commented 2 years ago

@freddydk how is the status on this one?

Until now we had been able to stay on an older the Generic Image version but with the current changes you we are forced to update due to no NextMajor container will start anymore or NextMajor-Pipeline will succeed.

As far as I was able to analyze the issue from @lippertmarkus this happens if you download a zip-file that contains a my folder.

I looks to me like like the condition for the if-block here is not met and the else-block is executed where Move-Item will fail due to the folder c:\run\my already exists.

NAVRockClimber commented 2 years ago

@freddydk I uploaded a test file for you here: https://glpmtstorage.blob.core.windows.net/cdn/build_main.zip

That one is used in out nextMajor pipelines.

edit: We pull it into the container by adding _-additionalParameters @("--env folders=c:\run=https://glpmtstorage.blob.core.windows.net/cdn/build_main.zip")_ to New-BcContainer.

freddydk commented 2 years ago

You can try to add this to your new-bccontainer:

-myscripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue512/start.ps1")

NAVRockClimber commented 2 years ago

I tested it and everything looks good so far. The NextMajor containers start regularly and I did not see any side effect on other containers. Will you create a new generic right away or do you have a release cycle?

freddydk commented 5 months ago

new generic images created long ago, assuming it was resolved long ago.