Daemon.json file not found in /etc/docker/

Issue type
No daemon.json file found in /etc/docker/

OS Version/build
Centos7 3.10.0-862.14.4.el7.x86_64

App version
Docker Community Edition (CE) 18.06.1-ce

Steps to reproduce
Using find searching / without luck, I need to change Docker Root Dir: /var/lib/docker

docker info output;
Docker Root Dir: /var/lib/docker

Found the following information in the below url;

Configure the Docker daemon
There are two ways to configure the Docker daemon:

Use a JSON configuration file. This is the preferred option, since it keeps all configurations in a single place.
Use flags when starting dockerd.

Docker daemon directory
The Docker daemon persists all data in a single directory. This tracks everything related to Docker, including containers, images, volumes, service definition, and secrets.

By default this directory is:

/var/lib/docker on Linux.

You can configure the Docker daemon to use a different directory, using the data-root configuration option.

Thanks for your time.

1 Like

If I understand you correctly, you try to change docker’s daemon.json file, but can’t find it.
This is because there is no daemon.json file if you haven’t created it yet. If you want to set custom options in this file you have to create it yourself: /etc/docker/daemon.json

2 Likes

Thanks paulxroot for your reply, I thought it would generated upon install…guess not, so I will need to search for the parameters for the daemon.json to be added. Cheers

Following up, I was able to find the information at these two locations.

https://kubernetes.io/docs/setup/cri/

1 Like

If you have installed Docker during default Ubuntu installation, it’s installed as a snap, and the config can be found at /var/snap/docker/current/config.

Not sure if this directory is replaced when Docker is updated.

2 Likes