【国产化系列】银河麒麟系统(龙芯3A4000)上docker安装指南

发布时间 2023-07-10 15:50:18作者: China Soft

 

1、Docker安装包下载

Docker - 龙芯开源社区 (loongnix.cn)

2、docker安装方法

直接使用deb安装包进行安装:

sudo dpkg –i docker-ce_18.06.3.ce-1_mips64el.deb
  • 1

注:采用rpm安装会存在大量依赖问题。

3、启动docker服务

systemctl start docker.service
  • 1

出现下述问题:docker服务启动不成功。

解决方案:
1、 创建镜像文件为/etc/docker/daemon.conf:

{
 "insecure-registries" : ["$your_registry:$your_registry_port"],
 "registry-mirrors": ["$your_registry_url"],
 "storage-driver": "devicemapper",
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
            }
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

4、制作基础镜像

4.1、通过tar 备份目录

tar -cvpf /home/buildrpm.tar --directory=/ --exclude=proc --exclude=sys --exclude=dev --exclude=run /
[root@localhost home]# ls
buildrpm.tar
  • 1
  • 2
  • 3

4.2、导入镜像

cat buildrpm.tar | docker import - buildrpm。
  • 1

如果提示Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
则先运行docker service

[root@localhost home]# service docker start
  • 1

4.3、运行

[root@localhost home]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
buildrpm            latest              15adc9614eb8        17 seconds ago      1.14 GB
[root@localhost home]# docker run -it buildrpm:latest /bin/bash
  • 1
  • 2
  • 3
  • 4

4.4、删除:

[root@localhost home]# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES
920f5a69f58d        buildrpm:latest     "/bin/bash"         2 minutes ago       Exited (0) 2 minutes ago                       laughing_minsky
[root@localhost home]# docker rm 920f5a69f58d
920f5a69f58d
[root@localhost home]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
buildrpm            latest              15adc9614eb8        4 minutes ago       1.14 GB
[root@localhost home]# docker rmi 15adc9614eb8
Untagged: buildrpm:latest
Deleted: sha256:15adc9614eb815974edfaca89671f86ea61e46929792c42f7515dfd65ff24688
Deleted: sha256:aed61d9930e43fbf0c5d3a771b9dde602b0dda2fec6066a166d2ba9180402880
[root@localhost home]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

5、升级gcc版本

http://ftp.loongnix.cn/toolchain/gcc/release/mips/gcc7/

6、参考