一个简单的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!"
相关推荐
小白的代码日记42 分钟前
Nginx学习与安装
运维·nginx
獭.獭.2 小时前
Linux -- 文件【下】
linux·服务器·文件系统·软硬链接·inode·ext2
破刺不会编程4 小时前
socket编程UDP
linux·运维·服务器·网络·c++·网络协议·udp
ayaya_mana5 小时前
Nginx性能优化与安全配置:打造高性能Web服务器
运维·nginx·安全·性能优化
NEXU510 小时前
Linux:套接字
linux·服务器·网络
我不要放纵11 小时前
docker
运维·docker·容器
morliz子轩11 小时前
基于WSL搭建Ubuntu 22.04.x LTS开发环境
linux·运维·ubuntu
BJ_Bonree11 小时前
数智先锋 | 告别运维黑盒!豪鹏科技×Bonree ONE构建全栈智能可观测体系
运维·科技
Janspran12 小时前
嵌入式linux学习 -- 进程和线程
linux·运维·学习
Cosmoshhhyyy12 小时前
linux远程部署dify和mac本地部署dify
linux·运维·macos