前言:
安装交叉编译环境,繁琐,耗时间,还得解决ubuntu版本不同,导致的各种错误。docker很好的解决了,不同版本,不同系统之间的差异性的问题。DOPI制作了docker方式的交叉编译环境。
工作环境:
vmare安装的ubuntu18.04
安装docker
-
参考链接
需要提前熟悉下docker的安装方法和docker的命令诠释
1.https://docs.docker.com/engine/install/
2. https://www.runoob.com/docker/docker-command-manual.html -
更新ubuntu的镜像源:
sudo chmod 777 /etc/apt/sources.list
vi /etc/apt/sources.list
从源中选择对应版本的更新源:复制到 source.list 中。
- 卸载老版本:
sudo apt-get remove docker docker-engine docker.io containerd runc
- 安装docker
sudo apt-get install -y curl
curl https://releases.rancher.com/install-docker/18.09.sh | sh
执行过程:
dopi@ubuntu:$ curl https://releases.rancher.com/install-docker/18.09.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 15521 100 15521 0 0 16406 0 --:--:-- --:--:-- --:--:-- 16389
Warning: the "docker" command appears to already exist on this system.
If you already have Docker installed, this script can cause trouble, which is
why we're displaying this warning and provide the opportunity to cancel the
installation.
If you installed the current Docker package using this script and are using it
again to update Docker, you can safely ignore this message.
You may press Ctrl+C now to abort this script.
+ sleep 20
+ sudo -E sh -c apt-get update
Hit:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease
Get:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease [74.6 kB]
Get:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease [88.7 kB]
Hit:5 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease