安装到硬盘
输入账号 root 开始安装
setup-alpine
开始安装;Select keyboard layout [none]: 是选择键盘布局,系统默认给你选了none,输入两次cn表示中文
时区选择
/ Which timezone are you in? (’?’ for list) [UTC]
国内输入PRC也可以输入“Asia/Shanghai” ;
Which disk(s) would you like to use? (or ‘?’ for help or ‘none’) [none] sda
选择一块磁盘,名称sda
How would you like to use it? (‘sys’, ‘data’, ‘lvm’ or ‘?’ for help) [?] sys
输入sys,格式化为系统盘
// WARNING: Erase the above disk(s) and continue? [y/N]: y
输入y确认格式化,等待格式化成功即可,格式化时间有点长,耐心等待即可。
简介
Small. Simple. Secure.
Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox.
操作
vi /etc/apk/repositories
把源里community前面的注释删除。
如下:
https://mirrors.ustc.edu.cn/alpine/latest-stable/main
https://mirrors.ustc.edu.cn/alpine/latest-stable/community
然后运行 ,更新软件源。
#更新软件源
apk update
apk upgrade
#安装 docker
apk add docker
#docker 添加到开机自启:
rc-update add docker boot
#启动 docker 服务
service docker start
service docker restart
#安装docker-compose
apk add docker-compose
#安装信息
apk add procps
配置docker仓库,使用国内cdn可以加速
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}
配置SSH登陆
vi /etc/ssh/sshd_config
#PermitRootLogin prohibit-password
这一行修改为:PermitRootLogin yes
配置硬盘
fdisk -l
fdisk /dev/sdd
fdisk /dev/sdc
fdisk /dev/sdb
n p 1 w
mkfs.ext4 /dev/sdc
blkid
vi /etc/fstab
/dev/sdb /wxedge1 ext4 defaults 0 0
/dev/sdc /wxedge2 ext4 defaults 0 0
/dev/sdd /wxedge3 ext4 defaults 0 0
mount -a
卸载磁盘
umount /dev/sdd
fdisk /dev/sdc