DevOps & Infra/Docker
[Docker] docker.service failed because the control process exited with error code. 에러
나른한댕댕이🐶
2022. 6. 21. 15:54
728x90
반응형
# 문제
- Docker 관련 환경변수를 변경하고 docker를 재시작하는 과정에서 다음과 같은 에러가 발생
$ sudo systemctl restart docker
>> Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
- 이후에 docker 컨테이너 상태를 확인해보려고 했는데 이 또한 다음과 같은 에러를 반환했다
$ sudo docker ps -a
>> Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
Is the docker daemon running?
# 해결 방안
- 서버를 재부팅하거나 직접 docker daemon을 활용하여 Docker를 실행하는 방법이 있다고 하였다. 다음 명령어로 실행을 하자 어떤 부분에서 오류가 발생했는지 확인할 수 있었다. 필자의 경우 daemon.json 파일에서 ", "를 지우지 않아서 json 문법에 위배되어 문제가 발생하였다.
$ sudo dockerd -D
>> unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character ']' looking for beginning of value
- docker deamon.json 파일을 수정한 이후 docker 시스템을 재시작했을 때 error 반환 없이 제대로 동작된 것을 확인했다.
$ sudo systemctl restart docker
728x90
반응형