sixeyed / diamol

Code samples for the book "Learn Docker in a Month of Lunches"
https://www.manning.com/books/learn-docker-in-a-month-of-lunches
Creative Commons Attribution Share Alike 4.0 International
496 stars 261 forks source link

Config & accessing interatively the container #33

Open eliassal opened 3 years ago

eliassal commented 3 years ago

Exercise CH- 6 Using Mounts - page 87

Question This is a question: When using How does the application knows it needs to read the app.settings from the config directoy and the one found in directory. Also, in the original app.settings, we have more yaml tags so we will lose them no? I managed to see the contents of appsettings in the container which is not changed

docker container exec eb110c8a cmd /C "type C:\app\appsettings.json "

OUTPUT

{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } }, "AllowedHosts": "*", "Database" : { "Provider" : "Sqlite" }, "ConnectionStrings": { "ToDoDb": "Filename=/data/todo-list.db" } }

still the basic details are there but logging is working as if it was magic :-) Also, If I understand well, This will not allow us to use the todo-list volume anymore, is this correct? 2nd, If I would like to access the container with docker exec -it cmd /c it does not allow as it shows directly the running app and can't do anything, typing Ctrl+C will terminate the app and exit the container. So How can I access the container in this case without stopping the container? Thanks