Ubuntu Docker自动化运维可以通过多种方式实现,以下是一些常见的方法和工具:
sudo apt update
sudo apt install -y docker.io
sudo docker run -d --restart=always \
--name=spug \
-p 80:80 \
-v /spug:/data \
registry.aliyuncs.com/openspug/spug
如果需要在Spug内使用Docker命令,则需要添加额外的参数:sudo docker run -d \
--restart=always \
--name=spug \
-p 80:80 \
-v /spug:/data \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /usr/bin/docker:/usr/bin/docker \
registry.aliyuncs.com/openspug/spug
sudo docker exec spug init_spug admin spug.dev
docker_install
的目录并进入。mkdir docker_install
cd docker_install
ansible.cfg
文件。cat <<EOF >> ansible.cfg
[defaults]
host_key_checking = False
inventory = inventory
EOF
inventory
文件,定义托管节点。cat <<EOF >> inventory
[docker]
rocky ansible_ssh_host=10.211.55.78
ubuntu ansible_ssh_host=10.211.55.75
EOF
sudo apt update
sudo apt upgrade
uname -als
lsb_release -a
top
htop
ps aux
netstat -tuln
df -h
free -h
cat /var/log/syslog
tail -f /var/log/syslog
sudo apt install package_name
sudo apt remove package_name
find / -name "filename"
sudo reboot
sudo shutdown -h now
whoami
su - username
sudo adduser newuser
sudo deluser user_to_delete
通过以上方法,你可以在Ubuntu上实现Docker自动化运维,提高运维效率和系统稳定性。
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: Ubuntu删除软件包的方法是什么