Docker Install

From ElectroDragon Wiki
Revision as of 18:57, 28 May 2020 by Chao (talk | contribs) (Created page with "== 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/#...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Install

  • apt-get install docker.ce
  • Install docker compose

For debian 8 or newer

Setup

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

Windows