Docker-ce是为了开发人员或小团队创建基于容器的应用,与团队成员分享和自动化的开发管道。docker-ce提供了简单的安装和快速的安装,以便可以立即开始开发。docker-ce集成和优化,基础设施,下面为大家分享一下Ubuntu下安装docker-ce具体步骤。
成都创新互联公司专业为企业提供元江县网站建设、元江县做网站、元江县网站设计、元江县网站制作等企业网站建设、网页设计与制作、元江县企业网站模板建站服务,10余年元江县做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。
操作系统:Ubuntu 18.04.4 LTS
LAN IP :192.168.3.22
Docker是现代软件开发和DevOps持续集成和部署管道中不可或缺的一部分,大部分公司都使用容器化技术,降低服务器成本。
root@linuxcool:~# apt-get update
root@linuxcool:~# apt-get -y install apt-transport-https ca-certificates curl software-properties-common
root@linuxcool:~# curl -fsSL https://mirrors.nwafu.edu.cn/docker-ce/linux/ubuntu/gpg | apt-key add -
Docker服务器在国外,如果使用docker.io来安装docker会非常慢,有时候还会超时断开导致无法安装成功;所以,我这里使用的是国内“西北农林科技大学网络与教育技术中心”镜像加速,国内还有很多镜像加速站点,比如:阿里云、腾讯云、网易、清华大学等,
root@linuxcool:~# apt-get -y update
root@linuxcool:~# apt-get -y install docker-ce
通过以上命令安装的是docker最新版本,如果要安装docker,请继续阅读下文,
查找Docker-CE的版本
apt-cache madison docker-ce
docker-ce | 5:19.03.8~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:19.03.7~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:19.03.6~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:19.03.5~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:19.03.4~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:19.03.3~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:19.03.2~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:19.03.1~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:19.03.0~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:18.09.9~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:18.09.8~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:18.09.7~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:18.09.6~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:18.09.5~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:18.09.4~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:18.09.3~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:18.09.2~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:18.09.1~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 5:18.09.0~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 18.06.3~ce~3-0~ubuntu | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 18.06.2~ce~3-0~ubuntu | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 18.06.1~ce~3-0~ubuntu | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 18.06.0~ce~3-0~ubuntu | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
docker-ce | 18.03.1~ce~3-0~ubuntu | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
安装指定版本的Docker-CE,比如要安装19.03.8~3-0~ubuntu-bionic
root@linuxcool:~# apt-get -y install docker-ce=19.03.8~3-0~ubuntu-bionic
root@linuxcool:~# docker version
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: afacb8b7f0
Built: Wed Mar 11 01:25:46 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: afacb8b7f0
Built: Wed Mar 11 01:24:19 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
创建daemon.json配置文件
root@linuxcool:~# vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://dockerhub.mirrors.nwafu.edu.cn/"]
}
默认daemon.json文件不存在,如果daemon.json文件不存在,自己创建
root@linuxcool:~# systemctl daemon-reload
root@linuxcool:~# systemctl restart docker
root@linuxcool:~# docker infoClient:Debug Mode: falseServer:Containers: 0 Running: 0 Paused: 0 Stopped: 0Images: 0Server Version: 19.03.8Storage Driver: overlay2 Backing Filesystem: Supports d_type: true Native Overlay Diff: trueLogging Driver: json-fileCgroup Driver: cgroupfsPlugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslogSwarm: inactiveRuntimes: runcDefault Runtime: runcInit Binary: docker-initcontainerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429runc version: dc9208a3303feef5b3839f4323d9beb36df0a9ddinit version: fec3683Security Options: apparmor seccomp Profile: defaultKernel Version: 5.3.0-51-genericOperating System: Ubuntu 18.04.4 LTSOSType: linuxArchitecture: x86_64CPUs: 8Total Memory: 15.64GiBName: linuxcoolID: K252:G32L:GWWN:J5FE:3MFZ:2ITG:UE7Y:Y26F:QT3Q:2PLS:HCUX:PJYZDocker Root Dir: /var/lib/dockerDebug Mode: falseRegistry: https://index.docker.io/v1/Labels:Experimental: falseInsecure Registries: 127.0.0.0/8Registry Mirrors: https://dockerhub.mirrors.nwafu.edu.cn/Live Restore Enabled: falseWARNING: No swap limit support
Registry Mirrors默认是docker.io,如果看到Registry Mirrors变https://dockerhub.mirrors.nwafu.edu.cn说明配置已经生效。
#自启服务
root@linuxcool:~# systemctl enable docker.service
#服务状态
root@linuxcool:~# systemctl status docker.service
#启动服务
root@linuxcool:~# systemctl start docker.service
#重启服务
root@linuxcool:~# systemctl restart docker.service
#停止服务
root@linuxcool:~# systemctl stop docker.service
root@linuxcool:~# docker pull centos:8.1.1911
8.1.1911: Pulling from library/centos
8a29a15cefae: Pull complete
Digest: sha256:fe8d824220415eed5477b63addf40fb06c3b049404242b31982106ac204f6700
Status: Downloaded newer image for centos:8.1.1911
docker.io/library/centos:8.1.1911
新闻标题:Ubuntu下安装docker-ce具体步骤
标题URL:http://www.shufengxianlan.com/qtweb/news24/80124.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联