Docker初体验之安装部署和镜像加速(openeuler版)

发布于:2024-03-12 ⋅ 阅读:(59) ⋅ 点赞:(0)

安装部署:

本人使用的为openeuler版本,无法使用二进制进行安装(使用二进制安装时,无法使用docker中的补全命令,需要重新进行配置)在此使用yum直接进行安装。

[root@localhost ~]# yum install docker

镜像加速:

1.docker cn加速

[root@localhost ~]# mkdir -p /etc/docker
[root@localhost ~]# tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
EOF

2.阿里云加速器

(1)注册并登录阿里云账号

(2)在服务台选择容器镜像服务,点击镜像工具,选择镜像加速器,选择与linux环境相匹配的操作文档进行配置(获得专用加速器地址)

[root@localhost ~]# mkdir -p /etc/docker
[root@localhost ~]# tee /etc/docker/daemon.json << EOF
> {
> "registry-mirrors":["https://lpk5rspy.mirror.aliyuncs.com"]
> }
> EOF
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker
[root@localhost ~]# systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.s>
     Active: active (running) since Mon 2024-03-11 20>
       Docs: https://docs.docker.com

(3)查看docker版本

[root@localhost ~]# docker version
Client:
 Version:           18.09.0
 EulerVersion:      18.09.0.332
 API version:       1.39
 Go version:        go1.17.3
 Git commit:        9942888
 Built:             Wed Dec 27 10:05:53 2023
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.09.0
  EulerVersion:     18.09.0.332
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.17.3
  Git commit:       9942888
  Built:            Wed Dec 27 10:05:15 2023
  OS/Arch:          linux/amd64
  Experimental:     false

网站公告

今日签到

点亮在社区的每一天
去签到