鲲鹏初探记 之 Docker安装(非yum install)
【摘要】 本文介绍了鲲鹏云服务器手动安装指定版本docker的方法,并设置华为云镜像加速。
1、找资源
#docker arm版各版本下载地址
https://download.docker.com/linux/static/stable/aarch64/
#找到想要的版本后,用wget下载
$ wget https://download.docker.com/linux/static/stable/aarch64/docker-18.09.8.tgz
2、解压后将文件夹中所有内容拷贝至“/usr/bin”文件夹下
$ tar xvpf docker-18.09.8.tgz
$ cp -p docker/* /usr/bin
3、安装前一些保障性准备工作
#暂时关闭SELinux及防火墙
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
4、配置docker.service文件
cat >/usr/lib/systemd/system/docker.service <<EOF
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target docker.socket
[Service]
Type=notify
EnvironmentFile=-/run/flannel/docker
WorkingDirectory=/usr/local/bin
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock --selinux-enabled=false --log-opt max-size=1g
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
5、启动服务,查看状态
systemctl daemon-reload
systemctl restart docker
systemctl enable docker
systemctl status docker
#查看版本
docker version
6、配置加速镜像
#编辑daemon.json文件
vi /etc/docker/daemon.json
#添加如下信息:
{ "registry-mirrors": ["https://{xxxxxxxxx}.mirror.swr.myhuaweicloud.com"] }
#registry-mirrors获取见下图
#重启docker
systemctl daemon-reload
systemctl restart docker
#验证
docker info
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)