Running OPC Server in a Docker container|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Running OPC Server in a Docker container
Avatar
Gaurav kakade
New Member
Members
Forum Posts: 2
Member Since:
04/20/2023
sp_UserOfflineSmall Offline
1
04/20/2023 - 04:52
sp_Permalink sp_Print sp_EditHistory

Hello,

I have a OPC Server created using the .net SDK running in a separate docker container inside a multi-docker environment. I want to use the IP Address of the Host Machine in the OPC UA Endpoint URL. 

So I gave ServerConfiguration.BaseAddresses = "opc.tcp://10.132.142.12:4840/OPCUA/qw", where 10.132.142.12 is the IP address of my Host Machine. Then I also have published and mapped the 4840 port of the docker container to Host port.

Now when I try to connect to this OPC Server from UA Expert using the Endpoint URL I am not able to connect to it. 

Is there any possible reason for this? 

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
04/20/2023 - 22:32
sp_Permalink sp_Print

The docker server is likely trying to bind to the 10.132.142.12 IP address which is not known and encountering an error during start up.

Check the logs to confirm this.

You should be able to specify localhost as the BaseAddress and 10.132.142.12 as an AlternateBaseAddress.

Avatar
Gaurav kakade
New Member
Members
Forum Posts: 2
Member Since:
04/20/2023
sp_UserOfflineSmall Offline
3
04/21/2023 - 01:52
sp_Permalink sp_Print

Yes, I do get some error in the start up. 

But If I ping this IP Address (10.132.142.12) from Docker container I get a response.

If I give 10.132.142.12 in AlternateBaseAddress I would still get the same errors right? Or will I be able to connect using this AlternateBaseAddress

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
04/22/2023 - 17:35
sp_Permalink sp_Print

Should should be connect. AlternateBaseAddresses exist to allow complex network configurations.

Avatar
Gabriel Verreault_1
New Member
Members
Forum Posts: 1
Member Since:
05/23/2023
sp_UserOfflineSmall Offline
5
05/23/2023 - 11:37
sp_Permalink sp_Print

Are you running your container in --network host?

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 42
Currently Browsing this Page:
3 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855