sudo systemctl restart docker
#进入容器
docker exec -it mymongo /bin/bash
#使用MongoDB客户端进行操作
mongo
# ERROR
[root@localhost ~]# sudo systemctl restart dock
Failed to restart dock.service: Unit not found.
[root@localhost ~]# docker exec -it mymongo /bin/bash
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
# 解决方法
[root@localhost ~]# systemctl restart docker