microsoft / navcontainerhelper

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

Best Practise for creating a container that can access the host's network resources #1551

Closed Rodtmclean closed 3 years ago

Rodtmclean commented 3 years ago

Hi,

I am fairly new to docker/bccontainer help etc. I'm looking for pointers in creating a BC container that can access the host's network resources. If you can point be in the correct direction that would be great.

Apologies if this is the wrong forum to post this type of basic question.

Regards & Thanks Roddy

freddydk commented 3 years ago

I think you would need to use transparent networking, but I am not sure. What specifically do you need to access?

staedter commented 3 years ago

@Rodtmclean We are using transparent networking in our infrastructure. It works quite nicely.

On the docker host machines (Windows Server 2019) we simply create a new transparent network named "pub" like this:

docker network create -d transparent pub

and then we just add this flag to the New-BcContainerHelper command:

-additionalParameters '--net="pub"'

At least with our networking infrastructure that works quite flawless (unless the DHCP-Range is full, but that is another problem all together xD)

Rodtmclean commented 3 years ago

Thanks, I am going with this :).