Docker Community Forums

Share and learn in the Docker community.

Docker container (on Windows) configuration file location

Hi,

I am working Docker containers on windows and I have faced some issues. It seems I could solved but I must check container configuration. Unfortunately I do not know where is the configuratin file of containers.

I work with Windows Server 2016 TP4 and I found some container files in C:\ProgramData\Docker\containers directory. Although I found some json files inside these directories they are do not contain any configuration entries.

GUID-json.log
config.json
hostconfig.json

Do you know where is the real configuration files which belong to container?

Thank you for your help.

:slightly_smiling:

Hi,

I have found them.

Configuration file in Windows: “C:\ProgramData\Docker\Containers<GUID of container>\config.json” és “C:\ProgramData\Docker\Containers<GUID of container>\hostconfig.json“

Notice:
Please make a copy from the configuration files. That could be usefull when yor container does not want to start adfter a Docker host restart. When you meet this message: “Win32 API call returned error r1=2147942452 err=You were not connected because a duplicate name exists on the network. If joining a domain, go to System in Control Panel to change the computer name and try again.” you merely need to overwrite the cinfig files from backup then your container will start correctly.

Read my blog regarding “Docker on Windows”: http://blog.fullsol.net/

1 Like

not anymore, any chance to update the location of those files ?
I can’t find them :frowning:

1 Like

We can’t access hypervisor directly on windows or mac-os. However we can access the files by creating a new container which syncs with it.

Create a container with alpine image, that mounts / as local volume. All the folders will be available in host directory.
docker run --rm -it -v /:/host alpine

I’m removing the container immediately after my job is done, its up to you though.

Once inside container, for config you can directly cd to /host/var/lib/docker/containers/ or do a chroot to host and to get linux directory structure.

chroot /host
cd /var/lib/docker/containers/

Stop the container before edits and restart docker desktop after edits for the changes to reflect.

1 Like

The preferred method for configuring the Docker Engine on Windows is using a configuration file. The configuration file can be found at 'C:\ProgramData\Docker\config\daemon.

Thank you for info.
merchant crypto