一个简单的ubuntu/开发板初始化脚本

创建一个脚本,用于安装必要组件和docker。以下是针对nano pi M1,使用的是H3芯片,因此docker用的源是arch=armhf,需要根据需求进行修改

bash 复制代码
#!/bin/bash

# 1. Update the system
sudo apt-get update && sudo apt-get upgrade -y

# 2. Install pip2 and pip3
sudo apt-get install python-pip python3-pip -y

# 3. Install Docker
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=armhf] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce -y

# Set Docker to start on boot
sudo systemctl enable docker
sudo systemctl start docker

# docker compose
sudo apt-get install libffi-dev libssl-dev -y
sudo apt-get install -y python3 python3-pip -y
sudo apt-get remove python-configparser -y
sudo pip3 install docker-compose

# 4. Install Portainer
docker volume create portainer_data
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

# 5. Install other common tools
sudo apt-get install -y git vim htop net-tools

echo "Setup complete!"
相关推荐
ShiXZ2138 分钟前
Docker Compose 安装与配置指南
运维·docker·容器
sulikey13 分钟前
个人Linux操作系统学习笔记11 - 环境变量
linux·笔记·学习
Kina_C20 分钟前
NFS与Autofs快速讲解-从原理到实战配置
linux·nfs·autofs
麦聪聊数据23 分钟前
企业数据市场建设(四):流程闭环与价值运营,让数据市场真正转起来
运维·数据库
皮卡狮23 分钟前
文件系统:磁盘硬件寻址和系统软件寻址
linux
是潮汕的灿灿展吖1 小时前
Centos离线部署nfs操作
linux·运维·centos
Kina_C1 小时前
Apache HTTP Server 安装、配置与高级功能详解
linux·http·apache
治愈系贝壳1 小时前
ARM --- day 6 时钟
linux·arm开发·学习
FII工业富联科技服务1 小时前
从灯塔工厂到AI Factory新模式:AI正在重构制造业的四大核心能力
大数据·运维·人工智能·重构·ar·制造
小五传输1 小时前
自主可控建设指南:Serv-u替代方案,实现平滑迁移业务不中断
大数据·运维·安全