买了个云服务器。第一步当然是想搭建docker,然后在docker的技术下自由翱翔,结果安装docker就陷入了滑铁卢:
按照官方文档,按照docker的时候https://docs.docker.com/engine/install/centos/,报错Failed to start docker.service: Unit not found.
网上解决方法如下:
https://stackoverflow.com/questions/42217526/cannot-start-docker-daemon-in-centos7
简述就是新建这个文件:/usr/lib/systemd/system/docker.socket
然后输入这些内容:
[Unit] Description=Docker Socket for the API PartOf=docker.service [Socket] ListenStream=/var/run/docker.sock SocketMode=0660 SocketUser=root SocketGroup=docker [Install] WantedBy=sockets.target
之后执行操作:
systemctl daemon-reload
systemctl start docker.socket
systemctl start docker
但是我认为这是下策,直接安装跑起来多好:
https://yq.aliyun.com/articles/110806?spm=a2c4e.11153959.blogcont29941.13.699e6d2fGhh68
按照阿里云这个教程,一次搞定。