簡介
由于部署服務(wù)器切換成基于ARM的架構(gòu),對應(yīng)的洪橘,在編譯的版本鏡像也必須基于ARM架構(gòu)的,因此需要在ARM的服務(wù)器上安裝docker版本并打包docker鏡像然后才能在其他ARM的服務(wù)器下進(jìn)行部署蝇裤。好消息是掷漱,docker版本就有ARM版本。
安裝
先看看服務(wù)器的版本
[root@Kylin /]# uname -a
Linux ecs-5725 4.19.90-17.5.ky10.aarch64 #1 SMP Fri Aug 7 13:35:33 CST 2020 aarch64 aarch64 aarch64 GNU/Linux
這臺是中標(biāo)麒麟服務(wù)器马昙,是標(biāo)準(zhǔn)的aarch64指令集的ARM架構(gòu)服務(wù)器桃犬。kylin服務(wù)器是基于redhat版本的,基本可以等同于centos行楞,所以熟悉centos的朋友操作麒麟應(yīng)該非常熟練攒暇。
由于在線安裝的方式,會遇到各種包缺失等提示(ARM架構(gòu)的生態(tài)目前還比不上x86的便利)子房,所以這里選用離線安裝的方式形用。
下載相關(guān)文件,認(rèn)準(zhǔn)aarch64標(biāo)識证杭,noarch代表全架構(gòu)支持
wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm
wget https://download.docker.com/linux/centos/8/aarch64/stable/Packages/containerd.io-1.4.3-3.1.el8.aarch64.rpm
wget https://download.docker.com/linux/centos/8/aarch64/stable/Packages/docker-ce-cli-19.03.14-3.el8.aarch64.rpm
wget https://download.docker.com/linux/centos/8/aarch64/stable/Packages/docker-ce-19.03.14-3.el8.aarch64.rpm
依次安裝田度,安裝是有順序,請安裝下面順序安裝解愤,不然會報各種錯誤
rpm -ivh container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm
yum install -y containerd.io-1.4.3-3.1.el8.aarch64.rpm
yum install -y docker-ce-cli-19.03.14-3.el8.aarch64.rpm
yum install -y docker-ce-19.03.14-3.el8.aarch64.rpm
啟動docker
sudo systemctl start docker
查看每币,可以看到 Architecture: aarch64 這一行代表是ARM架構(gòu)的docker
[root@Kylin /]# docker info
Client:
Debug Mode: false
Server:
Containers: 2
Running: 1
Paused: 0
Stopped: 1
Images: 9
Server Version: 19.03.14
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.19.90-17.5.ky10.aarch64
Operating System: Kylin Linux Advanced Server V10 (Tercel)
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 15.39GiB
Name: ecs-5725
ID: W7U7:LZIF:RT5Q:S4S4:SIK3:PZMU:OGXB:2NB2:YJVT:M7RL:VIYY:JMO2
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
測試hello word
[root@Kylin /]# sudo docker run hello-world
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.
(arm64v8)
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/
總結(jié)
由于docker官方就有ARM發(fā)行版,所以安裝起來算是比較順利的琢歇,唯一要注意的是根據(jù)自己服務(wù)器選定好對應(yīng)的docker版本兰怠,同時注意docker組件的安裝順序。