Docker Install
Install
- apt-get install docker.ce
- Install docker compose
For debian 8 or newer
- reference - https://docs.docker.com/v17.12/install/linux/docker-ce/debian/#install-using-the-repository
Setup
- sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
- Add Docker’s official GPG key: curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
- sudo apt-key fingerprint 0EBFCD88
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
Install and run
- sudo apt-get update
- sudo apt-get install docker-ce
- sudo docker run hello-world
Linux
- sudo apt-get install docker.io
- docker version #查看docker版本信息
don't use sudo everytime
- sudo gpasswd -a your_user_name docker #加入用户组
- sudo service docker restart
- newgrp - docker #使用新用户组,或者也可以断开终端重连生效
or
- //如果还没有 docker group 就添加一个(默认安装后已经有了)
- //sudo groupadd docker
- //将用户加入该 group 内。然后退出并重新登录就生效啦。
- sudo gpasswd -a ${your_user_name} docker
- //重启 docker 服务
- sudo service docker restart
- //切换当前会话到新 group, 或者关掉终端重新连接也会生效
- //newgrp - docker