斐讯N1刷armbian后更换中科大软件源,安装docker

系统环境

版本: Armbian_5.91_Aml-g12_Debian_buster_default_5.2.0_20190715.img 下载 Armbian
DTB: meson-gxl-s905d-phicomm-n1.dtb 下载DTB phicomm-n1.zip
armbian.png
以下记录自己的安装过程,备忘。

设置拥有者、属组

chown -R root:root /

更换中科大软件源

编辑/etc/apt/sources.list,内容为:

deb http://mirrors.ustc.edu.cn/debian stretch main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stretch-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stretch-backports main contrib non-free
deb http://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free

或下载解压替换:sources.zip

更新软件包

apt update && apt upgrade -y

安装 docker

获取get-docker.sh自动安装脚本、以阿里云镜像安装脚本内容。

curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh --mirror Aliyun

安装过程如下:

root@IYUU:~# curl -fsSL https://get.docker.com -o get-docker.sh
root@IYUU:~# sh get-docker.sh --mirror Aliyun
# Executing docker install script, commit: 6bf300318ebaab958c4adc341a8c7bb9f3a54a1a
+ sh -c apt-get update -qq >/dev/null
+ sh -c apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c curl -fsSL "https://mirrors.aliyun.com/docker-ce/linux/debian/gpg" | apt-key add -qq - >/dev/null
Warning: apt-key output should not be parsed (stdout is not a terminal)
+ sh -c echo "deb [arch=arm64] https://mirrors.aliyun.com/docker-ce/linux/debian buster stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
+ [ -n  ]
+ sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null
+ sh -c docker version
Client: Docker Engine - Community
 Version:           19.03.2
 API version:       1.40
 Go version:        go1.12.8
 Git commit:        6a30dfc
 Built:             Thu Aug 29 05:30:43 2019
 OS/Arch:           linux/arm64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.2
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.8
  Git commit:       6a30dfc
  Built:            Thu Aug 29 05:29:15 2019
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.2.6
  GitCommit:        894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc:
  Version:          1.0.0-rc8
  GitCommit:        425e105d5a03fabd737a126ad93d62a9eeede87f
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:

  sudo usermod -aG docker your-user

Remember that you will have to log out and back in for this to take effect!

WARNING: Adding a user to the "docker" group will grant the ability to run
         containers which can be used to obtain root privileges on the
         docker host.
         Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
         for more information.

配置 docker 使用阿里云镜像加速

阿里云镜像加速器地址获取:https://cr.console.aliyun.com/cn-beijing/instances/mirrors,用你的实际加速器地址,替换以下的https://XXXXXXX.mirror.aliyuncs.com

方法一:在 /etc/docker/daemon.json 中写入如下内容(如果文件不存在请新建该文件)

{
  "registry-mirrors": [
    "https://XXXXXXX.mirror.aliyuncs.com"
  ]
}

方法二:在 ssh 终端执行以下命令

mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://XXXXXXX.mirror.aliyuncs.com"]
}
EOF

systemctl daemon-reload
systemctl restart docker

安装过程如下:

root@IYUU:~# mkdir -p /etc/docker
root@IYUU:~# tee /etc/docker/daemon.json <<-'EOF'
> {
>   "registry-mirrors": ["https://XXXXXXX.mirror.aliyuncs.com"]
> }
> EOF
{
  "registry-mirrors": ["https://XXXXXXX.mirror.aliyuncs.com"]
}
root@IYUU:~# systemctl daemon-reload
root@IYUU:~# systemctl restart docker

启动 docker(开机启动、刷新配置、重启、启动)

加入开机启动,并重启

#开启启动
systemctl enable docker
#刷新配置
systemctl daemon-reload
#重启
systemctl restart docker
#启动
systemctl start docker

检查 docker 是否安装成功

docker -v
docker info
docker version

过程如下:

root@IYUU:~# docker -v
Docker version 19.03.2, build 6a30dfc

安装 docker 图形管理界面:Portainer

先创建volume,然后可选安装英文还在中文。

docker volume create portainer_data

[可选] 安装英文原版:

docker run -d -p 9000:9000 --restart=always --name portainer -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer:linux-arm64

[可选] 安装中文版UI:

先下载压缩包Portainer-CN.zip,解压至 /opt 目录:

# 下载汉化包
wget http://www.iyuu.cn/usr/uploads/portainer.zip
# 解压缩
unzip -o ./portainer.zip -d /opt
# 安装portainer
docker run -d -p 9000:9000 --restart=always --name portainer -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data -v /opt/public:/public portainer/portainer:linux-arm64

安装过程如下:

root@IYUU:~# docker volume create portainer_data
portainer_data
root@IYUU:~# docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer:linux-arm64
Unable to find image 'portainer/portainer:linux-arm64' locally
linux-arm64: Pulling from portainer/portainer
d1e017099d17: Pull complete
145bf8170f7a: Pull complete
Digest: sha256:31ba33c35266dd6dcfaec3cd76c057decd2ee6d2355ff135f4d1ce1cb42f4d57
Status: Downloaded newer image for portainer/portainer:linux-arm64
4459f0fd3ce755edb24d113da523581add74618d54ebcc64a006ca13f64ddab6

查看 Portainer

打开 http://N1的内网IP地址:9000 ,我的为:http://192.168.0.7:9000

http://192.168.0.7:9000
最后修改:2019 年 09 月 29 日 10 : 52 AM
如果觉得我的文章对你有用,请随意赞赏

发表评论