microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
379 stars 243 forks source link

Inconsistency in Image naming between New-NavContainer and New-BCImage #1191

Closed rbability closed 4 years ago

rbability commented 4 years ago

Describe the issue This is not an issue, probably more like a feature request.

New-NavContainer together with -ImageName creates an image which includes the Version in the auto-generated Tag name. New-BCImage however is just adding :latest as the tag when you use the -ImageName parameter and leave out the tag.

It would be fantastic if New-BCImage would follow the same principle as New-NavContainer in this regard. So you can pull the latest version of the Artifacts, let it create an image which automagically has the correct version in the Tag :-)

Example:

New-NavContainer `
 -accept_eula `
 -containerName test `
 -artifactUrl $artifactUrl `
 -Credential $credential `
 -auth UserPassword `
 -updateHosts `
 -imagename businesscentral/insider

When this is finished, we end up with an image named like businesscentral/insider:sandbox-17.0.15311.0-de

New-BCImage `
 -artifactUrl $artifacturl `
 -imageName businesscentral/insider`

When this is finished, we end up with an image named like businesscentral/insider:latest

NavContainerHelper is version 0.7.0.23
NavContainerHelper is running as administrator
Host is Microsoft Windows Server 2019 Version 1809 Build 17763.1339
Docker Client Version is 19.03.5
Docker Server Version is 19.03.5
...

Additional context

freddydk commented 4 years ago

That is by design.

New-BcImage creates the image you decide. New-BcContainer uses New-BcImage to "cache" an image and adds a naming algorithm to ensure that it selects the right image.

rbability commented 4 years ago

As I wrote, not a Bug, more a feature request :-) It would be very convenient to have the same behaviour for the -ImageName parameter when utilizing your cmdlets to populate a private repository.

Don't get me wrong, I am very happy with what we have right now, it already saves a lot of time.

freddydk commented 4 years ago

After writing my previous response, I did reconsider and I agree that it indeed would be nice to have New-BcImage make the same defaulting of the tag. I will fix this.

rbability commented 4 years ago

Awesome, Thank you so much for all the hard work you put into this 👍

freddydk commented 4 years ago

Note, that this fix will go into the BcContainerHelper module, NavContainerHelper will only get bug fixes. I will write a blog post about switching from NavContainerHelper to BcContainerHelper very soon, sorry for the inconvenience.

rbability commented 4 years ago

I don't see any inconvenience ;-) I'm glad you are doing this. Thanks for pointing that out, because I really thought they are the same (just different name), since there are BC Aliases for NAV cmdlets in the NavContainerHelper. I will switch ASAP then. Thanks for the heads up!

freddydk commented 4 years ago

Shipped in BcContainerHelper 1.0.1