最近又喜欢上了alpine
热议
2楼 LEB 昨天09:50
3楼 蒙面人 昨天09:50
netboot.xyz不行吗
4楼 breakmyheart 昨天10:48
https://gist.github.com/trimsj/c1fefd650b5f49ceb8f3efc1b6a1404d
这个试了吗
5楼 Smilence 昨天11:10
alpine有啥优势吗?
6楼 yrj 昨天13:12
alpine有啥优势吗?
就是小吧,一般docker用的
7楼 表妹 昨天14:01
我自己写了一个
8楼 抛砖引玉 昨天19:10
https://gist.github.com/trimsj/c1fefd650b5f49ceb8f3efc1b6a1404d
这个试了吗
试的就是这个,不行
9楼 抛砖引玉 昨天19:12
我自己写了一个
分享出来啊 我的亲妹
10楼 huanx 昨天19:17
我也之前转过 没转成功..
12楼 抛砖引玉 昨天22:20
LXC直接把修改网络配置那块改成复制interfaces就行了
#!/bin/sh -e
# Converts OpenVZ VPS to Alpine Linux
# WARNING: This script will wipe any data in your VPS!
# GPLv2; Partly based on https://gitlab.com/drizzt/vps2arch
server=http://images.linuxcontainers.org
path=$(wget -O- ${server}/meta/1.0/index-system | \
grep -v edge | awk '-F;' '($1=="alpine" && $3=="amd64") {print $NF}' | tail -1)
cd /
mkdir /x
wget ${server}/${path}/rootfs.tar.xz
tar -C /x -xf rootfs.tar.xz
sed -i '/getty/d' /x/etc/inittab
sed -i 's/rc_sys="lxc"/rc_sys="lxc"/' /x/etc/rc.conf
# save root password and ssh directory
sed -i '/^root:/d' /x/etc/shadow
grep '^root:' /etc/shadow >> /x/etc/shadow
[ -d /root/.ssh ] && cp -a /root/.ssh /x/root/
cp /etc/network/interfaces /x/etc/network/interfaces
cp /etc/resolv.conf /x/etc/resolv.conf
# remove all old files and replace with alpine rootfs
find / \( ! -path '/dev/*' -and ! -path '/proc/*' -and ! -path '/sys/*' -and ! -path '/x/*' \) -delete || true
/x/lib/ld-musl-x86_64.so.1 /x/bin/busybox cp -a /x/* /
export PATH="/usr/sbin:/usr/bin:/sbin:/bin"
rm -rf /x
apk update
apk add openssh bash htop nano
echo PermitRootLogin yes >> /etc/ssh/sshd_config
rc-update add sshd default
rc-update add mdev sysinit
rc-update add devfs sysinit
#sh # (for example, run `passwd`)
sync
reboot -f
13楼 抛砖引玉 昨天22:23
LXC直接把修改网络配置那块改成复制interfaces就行了
这样写对不对
14楼 ChinaDNS 昨天22:42
这样写对不对
15楼 52Fancy 昨天23:07
是kvm吗?可以试试我签名的脚本
16楼 抛砖引玉 2小时前
是kvm吗?可以试试我签名的脚本
不是 是lxc
17楼 抛砖引玉 1小时前
你现在用的是debian/ubuntu的话 对
还是不行,脚本是运行成功的,就是重启后失联
申明:本文内容由网友收集分享,仅供学习参考使用。如文中内容侵犯到您的利益,请在文章下方留言,本站会第一时间进行处理。
谷姐靓号网




评论前必须登录!
立即登录 注册