Configuring applications outside of Docker desktop environments needs to be done carefully. For seamless integration, we must know how to add the required configurations. In this article, we will explore the essential steps to successfully add configuration for a non-Docker desktop environment, ensuring efficiency and reliability in our development workflow.
As Vikrant Punwatkar explained in his “Sitecore Containers without Docker Desktop” article, running containers without Docker Desktop is possible. However, after successfully implementing this approach, it was observed that we could not debug the project source code.
Investigation
The default location of the configuration file on Windows is shown below. This “config” option allows us to set any configuration option for the daemon in a JSON format.
~\programdata\docker\config\daemon.json
We can see that the “config” folder is missing from the above-mentioned path. As a result, our solution was acting strangely, and we could not debug the container-based source code.
Solution
The issue can be resolved once we add the required “config” folder and the required “daemon.json” file with the necessary configurations. It can be accomplished by downloading and executing the “Create Config File Script” which will automatically generate the necessary “config” folder and “daemon.json” file in addition to the necessary configurations.
Note: Any “PowerShell” script that we download and attempt to execute on a “PowerShell” terminal will result in the error below.
The file "specific PowerShell script file name" is not digitally signed. You cannot run this script on the current system.
This problem can be fixed by executing the following command on a “PowerShell” terminal.
Set-ExecutionPolicy Bypass -Scope Process
Steps to Add Configurations Manually:
-
- Check the “~\programdata\docker” path and see if the “config” folder is present or not.
- Create a folder and name it as “config”, if it is not present.
- Create a “daemon.json” file inside the “config” folder.
- Add the following data in the “daemon.json” file.
{ "debug": true, "dns": [ "8.8.8.8" ], "experimental": false }
Note:
- These are the basic configurations, and they can be modified, or additional configurations can be added depending on the project and its requirements.
- “DNS” configurations can differ based on the project and its architecture.
Conclusion
The configuration file while using “Docker Desktop” is generated automatically once we add or modify the required configurations from the “Docker Desktop Settings” menu. But in this scenario, we have to create it manually, as the “daemon.json” file is crucial for customizing and configuring the Docker daemon to meet specific requirements, including security, network, and resource settings.
Happy learning!
Nice!!!
Thank you..!!