请参考:
https://blog.csdn.net/u013948858/article/details/78429954
# 问题:安装Docker之后,执行docker run hello-world 命令,权限报错。
daemonnnn@daemonnnn-virtual-machine:~$ docker --version Docker version 18.09.3, build 774a1f4 daemonnnn@daemonnnn-virtual-machine:~$ docker run hello-world docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/create: dial unix /var/run/docker.sock: connect: permission denied. See 'docker run --help'.
解决:
安装完Docker后,有个提示:
当要以非root用户可以直接运行docker时,需要执行 sudo usermod -aG docker runoob 命令,然后重新登陆,否则会有报错。
If you would like to use Docker as a non-root user, you should now consider adding your user to the "docker" group with something like: sudo usermod -aG docker runoob Remember that you will have to log out and back in for this to take effect!
# 问题:点击Docker Quickstart Terminal 出现Windows正在查找bash.exe
这里,Windows正在查找git-bash.exe,所以查看Docker Quickstart Terminal 有没有指向git-bash.exe,看其属性:
解决:
更改目标至D盘下的git目录:
镜像操作
新增
下载 docker pull image_name:tag
使用 docker run iamge_name:tag
修改
删除
docker rmi image_name
查看
docker images
docker search image_name
构建
docker build -t image_name
Docker中没有ifconfig命令
原因:Docker的设计哲学不推荐设置IP,而是使用host配置
如何添加ifconfig命令?
apt-get update apt install net-tools # ifconfig apt install iputils-ping # ping