➜ ~ curl -fsSL get.docker.com -oget-docker.sh ➜ ~ sudo shget-docker.sh --mirror Aliyun # Executing docker install script, commit: f45d7c11389849ff46a6b4d94e0dd1ffebca32c1 + sh -c apt-getupdate -qq >/dev/null + sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null + sh -c curl -fsSL "https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg" | apt-key add -qq - >/dev/null Warning: apt-key output should not be parsed (stdout is not a terminal) + sh -cecho"deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic stable" > /etc/apt/sources.list.d/docker.list + sh -c apt-getupdate -qq >/dev/null W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:49and /etc/apt/sources.list.d/docker.list:1 W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:49and /etc/apt/sources.list.d/docker.list:1 W: Target Translations (stable/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:49and /etc/apt/sources.list.d/docker.list:1 W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:49and /etc/apt/sources.list.d/docker.list:1 W: Target CNF (stable/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:49and /etc/apt/sources.list.d/docker.list:1 W: Target CNF (stable/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:49and /etc/apt/sources.list.d/docker.list:1 W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:49and /etc/apt/sources.list.d/docker.list:1 W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:49and /etc/apt/sources.list.d/docker.list:1 W: Target Translations (stable/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:49and /etc/apt/sources.list.d/docker.list:1 W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:49and /etc/apt/sources.list.d/docker.list:1 W: Target CNF (stable/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:49and /etc/apt/sources.list.d/docker.list:1 W: Target CNF (stable/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:49and /etc/apt/sources.list.d/docker.list:1 + [ -n ] + sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null + sh -c docker version Client: Docker Engine - Community Version: 19.03.4 API version: 1.40 Go version: go1.12.10 Git commit:9013bf583a Built: Fri Oct 1815:54:092019 OS/Arch: linux/amd64 Experimental: false
Server: Docker Engine - Community Engine: Version: 19.03.4 API version: 1.40 (minimum version1.12) Go version: go1.12.10 Git commit:9013bf583a Built: Fri Oct 1815:52:402019 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.10 GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339 runc: Version: 1.0.0-rc8+dev GitCommit:3e425f80a8c931f88e6d94a8c831b9d5aa481657 docker-init: Version: 0.18.0 GitCommit: fec3683 If you would like to use Docker asa non-root user, you should now consider adding your user to the "docker" group with something like:
sudo usermod -aG docker your-user
Remember that you will have tolog out and back in for this to take effect!
WARNING: Adding a user to the "docker" group will grant the ability to run containers which can be used to obtain root privileges on the docker host. Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface for more information.
将用户测试加入 docker 组里面
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
If you would like to use Docker as a non-root user, you should nowconsider adding your userto the "docker"groupwith something like:
sudo usermod -aG docker your-user
Remember that you will have tologoutand back infor this to take effect!
WARNING: Adding a userto the "docker"group will grant the ability to run containers which can be used to obtain root privilegeson the docker host. Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface for more information. ➜ ~ ➜ ~ ➜ ~ sudo usermod -aG docker root ➜ ~ id root uid=0(root) gid=0(root) groups=0(root),999(docker) ➜ ~ systemctl start docker ➜ ~ systemctl status docker