✅ ✅ Generate migrations with EF on sqlserver image docker taking too much time
Hello , it's my first time making questions here , so if i forgot to provide some information , please , let me know.
Recently i changed my Sql Express to sql image docker , and generated my migrations in it , but i realize that when i use Sql Image docker take too long than SqlExpress to generate my database and tables. When i do the "database update" it get stuck in "Opening connection to database 'Lets_Person' on server 'localhost,1433'" and takes minutes to proceed. I'd like to know if i 'm doing somenthing wrong , and if i need any more configuration both System and docker. Follow my connection strings that i use to generate migrations:
"Server=localhost,1433;Initial Catalog=Lets_Person;Persist Security Info=True;User ID=sa;Password=Teste@123;MultipleActiveResultSets=True;Encrypt=True;TrustServerCertificate=True;Connection Timeout=300;",
9 Replies
im confused, what are you attempting to do?
ur trying to migrate a database in the container?
Yes
whats ur dockerfile
are you sure the db is runnign?
I'm trying to generate my databases and tables into an Sql Server runing docker , the image is working
But i don't understand why Entity Framework taking too long to generate the database and tables into an running image
When i connect with sql management studio , runs normally , and has no problems, but when i do in project "dotnet ef database update -v -s name_of_project " stuck in the message where i painted it red
it measn it cant connect basically
whats your dockerfile
until i see the dockerfile theres not much i can tell you
Hey , i achieved resolve the problem , just for the record i generated my container without docker compose file and i had no access to dockerfile ( i don't know how to retrieve this file without docker-compose.yml , i'm beginner on docker) . I made the "docker pull" and "docker run " from the official sql server image, as default , the port is set up to 1433 and i have to change 1433:1433 to 1450:1433 , after that i put in my connection string the property Connection Timeout set up to 500. I don't know if it's right do these things , but works fine now.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.