【docker_ubuntu2604】:docker安装和配置
【docker_ubuntu2604】:docker安装和配置
一、基本说明
1、 docker,从国外获取资源时,网速较慢。因此,需要使用国内的镜像网站,来提升获取资源的速度。
二、docker安装和配置
1、 docker安装
# ubuntu2604,有效
# 下载并执行Docker官方安装脚本
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# 启动服务docker;开机自动启动服务docker
sudo systemctl start docker
sudo systemctl enable docker
2、 配置国内加速网站docker( /etc/docker/daemon.json )
{
"registry-mirrors":
[ "https://docker.1ms.run",
"https://docker.mirrors.tuna.tsinghua.edu.cn",
"https://m.daocloud.io",
"https://docker.xuanyuan.me",
"https://reg-mirror.qiniu.com",
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com"
]
}
[wit@ubuntu:docker]$ pwd
/etc/docker
[wit@ubuntu:docker]$
[wit@ubuntu:docker]$ ls
daemon.json
[wit@ubuntu:docker]$
[wit@ubuntu:docker]$ sudo cat daemon.json
{
"registry-mirrors":
[ "https://docker.1ms.run",
"https://docker.mirrors.tuna.tsinghua.edu.cn",
"https://m.daocloud.io",
"https://docker.xuanyuan.me",
"https://reg-mirror.qiniu.com",
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com"
]
}
[wit@ubuntu:docker]$
[wit@ubuntu:docker]$
[wit@ubuntu:docker]$ sudo systemctl daemon-reload
[wit@ubuntu:docker]$
[wit@ubuntu:docker]$ sudo systemctl restart docker
[wit@ubuntu:docker]$
3、 检验docker是否安装成功:
[wit@ubuntu:docker]$ sudo docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
三、参考资料:
1、 docker 安装 -- https://www.runoob.com/docker/ubuntu-docker-install.html
2、 docker 教程 -- https://www.runoob.com/docker/docker-tutorial.html
3、 docker 相关网站资源 -- https://www.runoob.com/docker/docker-resources.html
4、 docker 官网 -- https://www.docker.com/
5、 docker 官方文档 -- https://docs.docker.com/
.
本文由 lnlidawei 原创、整理、转载,本文来自于【博客园】; 整理和转载的文章版权归属【原创作者】; 转载或引用时【请保留文章的来源信息】:https://www.cnblogs.com/lnlidawei/p/19840980

浙公网安备 33010602011771号