1

This question has already been asked here, but no one has answered it (also asked here without any answers). I'd like to try to get it answered.

I have a Linux Docker Image containing a console app that connects to a local DB instance. DB is on my local PC and not in the docker image

Local server Name : RIXS\RSERVER

Connection String : optionsBuilder.UseSqlServer(@"Server=RIXS\RSERVER;Database=MyTable1;Trusted_Connection=True;MultipleActiveResultSets=true");

I've tried Adding the docker image to my SQL Servername

  1. dac7889b09b0\RIXS\RSERVER

  2. dac7889b09b0\RSERVER

But I'm obviously doing something wrong. Any idea?

1

1 Answer 1

1

Start the container with network mode as host.

docker run --network=host ...

The host mode will make the container share the network interfaces of the host. Thus an address of localhost or 127.0.0.1 inside the container will refer to the host machine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.