龙芯安装Docker
本文章使用龙芯3A6000处理器,Loongnix操作系统。
官方文档:
http://docs.loongnix.cn/loongnix/cloud/docker/manual.html
1 安装Docker
1.1 卸载docker
sudo apt remove docker
1.2 更新
sudo apt update
1.3 安装Docker
sudo apt install docker-ce docker-ce-cli containerd.io
1.4 配置镜像仓库
如果安装出现以下错误:
Process: 5566 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 5566 (code=exited, status=1/FAILURE)
dpkg: 处理软件包 docker-ce (--configure)时出错:
已安装 docker-ce 软件包 post-installation 脚本 子进程返回错误状态 1
dpkg: 依赖关系问题使得 docker-ce-rootless-extras 的配置工作不能继续:
docker-ce-rootless-extras 依赖于 docker-ce;然而:
软件包 docker-ce 尚未配置。
dpkg: 处理软件包 docker-ce-rootless-extras (--configure)时出错:
依赖关系问题 - 仍未被配置
正在处理用于 systemd (241-7.lnd.11) 的触发器 ...
在处理时有错误发生:
docker-ce
docker-ce-rootless-extras
E: Sub-process /usr/bin/dpkg returned an error code (1)
则需要配置龙芯容器镜像仓库。
在/etc/docker/daemon.json
中追加以下内容 ,如果文件不存在请手动创建。
{
"registry-mirrors": ["https://cr.loongnix.cn"]
}
1.5 重启docker
systemctl daemon-reload
systemctl restart docker
1.6 验证docker
1、获取docker版本
sudo docker version
显示如下:
Client:
Version: 20.10.3
API version: 1.41
Go version: go1.15.6
Git commit:
Built: Wed Mar 23 10:35:26 2022
OS/Arch: linux/loong64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.3
API version: 1.41 (minimum version 1.12)
Go version: go1.15.6
Git commit:
Built:
OS/Arch: linux/loong64
Experimental: false
containerd:
Version: 1.4.3-1-g6fbe2f9
GitCommit: 6fbe2f9a8e085ffeb72c00027c4f9**********
runc:
Version: 1.0.0-rc93+dev
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
2、docker运行:
sudo docker run hello-world
显示如下:
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
91813249ceeb: Pull complete
Digest: sha256:645c181ed190871e4029bf059242e68261e106096bd08c0d11635449e1b88ff6
Status: Downloaded newer image for hello-world:latest
WARNING: The requested image's platform (linux/loongarch64) does not match the detected host platform (linux/loong64) and no specific platform was requested
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/
参考链接:
https://blog.csdn.net/q610376681/article/details/90483576