阅读量:0
银河麒麟高级服务器操作系统V10SP2(X86)安装docker-engine-18.09版本
一 系统环境
[root@localhost ~]# nkvers ############## Kylin Linux Version ################# Release: Kylin Linux Advanced Server release V10 (Sword) Kernel: 4.19.90-24.4.v2101.ky10.x86_64 Build: Kylin Linux Advanced Server release V10 (SP2) /(Sword)-x86_64-Build09/20210524 #################################################
二 安装docker
2.1 配置外网源(默认配置如下)
[root@localhost ~]# cat /etc/yum.repos.d/kylin_x86_64.repo ###Kylin Linux Advanced Server 10 - os repo### [ks10-adv-os] name = Kylin Linux Advanced Server 10 - Os baseurl = http://update.cs2c.com.cn:8080/NS/V10/V10SP2/os/adv/lic/base/$basearch/ gpgcheck = 1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kylin enabled = 1 [ks10-adv-updates] name = Kylin Linux Advanced Server 10 - Updates baseurl = http://update.cs2c.com.cn:8080/NS/V10/V10SP2/os/adv/lic/updates/$basearch/ gpgcheck = 1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kylin enabled = 1 [ks10-adv-addons] name = Kylin Linux Advanced Server 10 - Addons baseurl = http://update.cs2c.com.cn:8080/NS/V10/V10SP2/os/adv/lic/addons/$basearch/ gpgcheck = 1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kylin enabled = 0
2.2 查看外网源中docker最新版本(docker-engine-18.09版本)
[root@localhost ~]# yum list | grep docker docker-runc.x86_64 1.0.0.rc3-103.ky10 @anaconda docker-anaconda-addon.x86_64 0.4-10.ky10 ks10-adv-os docker-compose.noarch 1.22.0-4.ky10 ks10-adv-os docker-engine.x86_64 18.09.0-202.p08.ky10 ks10-adv-updates docker-proxy.x86_64 0.8.0.dev.2-100.p01.ky10 ks10-adv-updates docker-runc.x86_64 1.0.0.rc3-205.p03.ky10 ks10-adv-updates pcp-pmda-docker.x86_64 4.1.3-12.p06.ky10 ks10-adv-updates podman-docker.noarch 1:0.10.1-8.ky10 ks10-adv-updates python-docker-tests.noarch 4.0.2-1.ky10 ks10-adv-os python-dockerpty-help.noarch 0.4.1-1.ky10 ks10-adv-os python2-docker.noarch 4.0.2-1.ky10 ks10-adv-os python2-docker-pycreds.noarch 0.4.0-1.1.ky10 ks10-adv-os python2-dockerpty.noarch 0.4.1-1.ky10 ks10-adv-os python3-docker.noarch 4.0.2-1.ky10 ks10-adv-os python3-docker-pycreds.noarch 0.4.0-1.1.ky10 ks10-adv-os python3-dockerpty.noarch 0.4.1-1.ky10 ks10-adv-os
2.3 安装docker
[root@localhost ~]# yum install docker -y 上次元数据过期检查:0:30:49 前,执行于 2024年04月22日 星期一 15时10分21秒。 依赖关系解决。 ============================================================================================================================================================================================================================================== Package Architecture Version Repository Size ============================================================================================================================================================================================================================================== 安装: docker-engine x86_64 18.09.0-202.p08.ky10 ks10-adv-updates 45 M 事务概要 ============================================================================================================================================================================================================================================== 安装 1 软件包 总下载:45 M 安装大小:188 M 下载软件包: docker-engine-18.09.0-202.p08.ky10.x86_64.rpm 2.8 MB/s | 45 MB 00:16 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 总计 2.8 MB/s | 45 MB 00:16 运行事务检查 事务检查成功。 运行事务测试 事务测试成功。 运行事务 准备中 : 1/1 安装 : docker-engine-18.09.0-202.p08.ky10.x86_64 1/1 运行脚本: docker-engine-18.09.0-202.p08.ky10.x86_64 1/1 Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service. /sbin/ldconfig: /usr/lib64/libLLVM-7.so 不是符号链接 验证 : docker-engine-18.09.0-202.p08.ky10.x86_64 1/1 已安装: docker-engine-18.09.0-202.p08.ky10.x86_64 完毕!
2.4 启动服务并设置开机自启
[root@localhost ~]# systemctl restart docker [root@localhost ~]# systemctl enable docker
2.5 导入测试的docker镜像
以下镜像用对应物理机操作系统版本(V10-SP2-0524)的docker镜像测试 [root@localhost ~]# ls 公共 模板 视频 图片 文档 下载 音乐 桌面 anaconda-ks.cfg initial-setup-ks.cfg Kylin-Server-10-SP2-Release-Build09-Docker-20210524-X86_64.xz [root@localhost ~]# [root@localhost ~]# docker load -i Kylin-Server-10-SP2-Release-Build09-Docker-20210524-X86_64.xz e0d4d61f5225: Loading layer [==================================================>] 323.5MB/323.5MB db0a4a95ca8e: Loading layer [==================================================>] 2.048kB/2.048kB 534cfc05830b: Loading layer [==================================================>] 48.8MB/48.8MB Loaded image: kylin-server-10-sp2-x86:b09
2.6 启动docker容器
2.6.1 前台启动
[root@localhost ~]# docker run --name kylin-test1 -it 907d7ff37c7c bash [root@df65f74d0d68 /]# [root@df65f74d0d68 /]# exit exit [root@localhost ~]#
2.6.2 后台启动
[root@localhost ~]# docker run --name kylin-test2 -itd 907d7ff37c7c bash 1e8ce4362e8ed4a158557c363d9d5bd7b55db1ab0861adc9795b3c03786b1f72 [root@localhost ~]#
2.6.3 查看启动的容器信息
[root@localhost ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1e8ce4362e8e 907d7ff37c7c "bash" 6 seconds ago Up 5 seconds kylin-test2 df65f74d0d68 907d7ff37c7c "bash" 17 seconds ago Exited (0) 13 seconds ago kylin-test1