Unable to configure the Docker daemon with file /etc/docker/daemon.json

Pesan eror yang ada pada judul terjadi ketika kita mencoba untuk melakukan konfigurasi docker menggunakan file yang berada di /etc/docker/daemon.json.

Ketika kita melakukan debugging menggunakan journalctl -xe -u docker , maka pesan berikut akan tampil

Aug 01 06:55:35 myhost systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has begun starting up.
Aug 01 06:55:35 myhost dockerd-current[10880]: unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: storage-driver: (from flag: overlay, from file: overlay)
Aug 01 06:55:35 myhost systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Aug 01 06:55:35 myhost systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
Aug 01 06:55:35 myhost systemd[1]: Unit docker.service entered failed state.
Aug 01 06:55:35 myhost systemd[1]: docker.service failed.

Akar permasalahan munculnya eror ini adalah karena konfigurasi /etc/docker/daemon.json  konflik dengan konfigurasi storage default dari docker yang berada di /etc/sysconfig/docker-storage  dan  /etc/sysconfig/docker-storage-setup . Untuk mengatasi masalah ini, hapus saja 2 file yang konflik tersebut

rm -f /etc/sysconfig/docker-storage /etc/sysconfig/docker-storage-setup

 

Leave A Comment