N1 armbian 安装docker及可视化面板

更换源 根据自己的armbian版本选择debain还是Ubuntu我的是Jammy 对应的Ubuntu

Armbian 软件仓库

https://mirrors.tuna.tsinghua.edu.cn/armbian/

https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

项目简介
Armbian 是为 ARM 单板机提供的基于 Debian 和 Ubuntu 的操作系统。Armbian 仓库包括专用的 u-boot、内核及各种支持文件。

使用方法
可以使用以下方法更换软件源:

运行 armbian-config -> Personal -> Mirrors -> 选择镜像站。
编辑 /etc/apt/sources.list.d/armbian.list,将 http://apt.armbian.com 替换为以下链接 (注意书写格式)

https://mirrors.tuna.tsinghua.edu.cn/armbian

然后执行 apt update。

这可以由以下命令完成

sed -i.bak 's#http://apt.armbian.com#https://mirrors.tuna.tsinghua.edu.cn/armbian#g' /etc/apt/sources.list.d/armbian.list
apt update

 

nano /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
 
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse

更多源

https://blog.csdn.net/zhuiqiuzhuoyue583/article/details/88777483

更新

apt-get update

 

根据提示更换key(多个key多执行)

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys *******

 

安装docker

apt install docker.io

 

# 推荐安装(更换源以后没必要了)

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

 

如何更新容器
举例:Portainer更新
1.停止旧的容器

docker stop portainer

 

2.删除旧的容器

docker rm portainer

 

3.删除旧的镜像

docker rmi portainer/portainer

 

# 安装 portainer 汉化版

docker run --restart always --name fast -p 8081:8081 -d -v /var/run/docker.sock:/var/run/docker.sock wangbinxingkong/fast

 

删除portain

docker container stop **

 

docker rm NAME/CONTAINER **

 

***即ID,可在重新安装portainer时获取

docker container rm -f portainer

 

# 手动安装 - 成功率不高

wget https://download.docker.com/linux/debian/dists/buster/pool/stable/arm64/docker-ce_19.03.8~3-0~debian-buster_arm64.deb
sudo dpkg -i docker-ce*.deb
sudo apt -f install

 

卸载docker Uninstall Docker Engine

 

1.删除docker及安装时自动安装的所有包

apt-get autoremove docker docker-ce docker-engine  docker.io  containerd runc

2.查看docker是否卸载干净

dpkg -l | grep docker

删除无用的相关的配置文件

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

3.删除没有删除的相关插件

apt-get autoremove docker-ce-*

4.删除docker的相关配置&目录

rm -rf /etc/systemd/system/docker.service.d
rm -rf /var/lib/docker

5.确定docker卸载完毕

docker --version

 

Uninstall the Docker Engine, CLI, containerd, and Docker Compose packages:

 

sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras

 

Images, containers, volumes, or custom configuration files on your host aren't automatically removed. To delete all images, containers, and volumes:

 

sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

 

You have to delete any edited configuration files manually.

THE END