安装docker root@instance-wortxz7y-2:~# curl -sSL https://get.daocloud.io/docker | sh # Executing docker install script, commit: 4f282167c425347a931ccfd95cc91fab041d414f
- sh -c apt-get update -qq >/dev/null
- sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
- sh -c mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings
- sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
- sh -c chmod a+r /etc/apt/keyrings/docker.gpg
- sh -c echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu bionic stable" > /etc/apt/sources.list.d/docker.list
- sh -c apt-get update -qq >/dev/null
- sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-scan-plugin >/dev/null
- version_gte 20.10
- [ -z ]
- return 0
- sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce-rootless-extras >/dev/null
- sh -c docker version Client: Docker Engine - Community Version: 20.10.19 API version: 1.41 Go version: go1.18.7 Git commit: d85ef84 Built: Thu Oct 13 16:46:19 2022 OS/Arch: linux/amd64 Context: default Experimental: true
Server: Docker Engine - Community Engine: Version: 20.10.19 API version: 1.41 (minimum version 1.12) Go version: go1.18.7 Git commit: c964641 Built: Thu Oct 13 16:44:11 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.8 GitCommit: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0
================================================================================
To run Docker as a non-privileged user, consider setting up the Docker daemon in rootless mode for your user:
dockerd-rootless-setuptool.sh install
Visit https://docs.docker.com/go/rootless/ to learn about rootless mode.
To run the Docker daemon as a fully privileged service, but granting non-root users access, refer to https://docs.docker.com/go/daemon-access/
WARNING: Access to the remote API on a privileged Docker daemon is equivalent to root access on the host. Refer to the 'Docker daemon attack surface' documentation for details: https://docs.docker.com/go/attack-surface/
================================================================================ 查看docker状态 root@instance-wortxz7y-2:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES root@instance-wortxz7y-2:~#
标签:version,apt,sh,https,Ubuntu,docker,安装,Docker From: https://blog.51cto.com/chinak/5756200