Alpine as Host OS

Download the "virtual" ISO file from https://www.alpinelinux.org/downloads/ with wget

- virtual-aarch64(ARM64) / virtual-x86_64(AMD64)

SSH Port change (/etc/ssh/sshd_config)

Remove intro text /etc/motd

/etc/apk/repositories

#/media/sda/apks
http://dl-cdn.alpinelinux.org/alpine/edge/main
http://dl-cdn.alpinelinux.org/alpine/edge/community

Setting ZRAM

apk add zram-init
vi /etc/conf.d/zram-init # Modify num_devices / size0
rc-service zram-init start
rc-update add zram-init

Install duf

apk add \
--no-cache \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
duf

Install apks

apk add ddclient docker docker-compose curl sshpass ufw
rc-update add docker
rc-update add ddclient

Setting Fail2Ban

apk add fail2ban
vi /etc/fail2ban/jail.conf # enabled = true, maxretry = 3, bantime = 3600
rc-service fail2ban start
rc-update add fail2ban

crontab base script for docker firewall, memory save, auto update

@reboot sleep 25 && iptables -I DOCKER-USER -i eth0 -j DROP
@reboot sleep 30 && iptables -I DOCKER-USER -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
@reboot sleep 31 && iptables -I DOCKER-USER -p tcp -m conntrack --ctorigdstport 80 --ctdir ORIGINAL -j ACCEPT
@reboot sleep 32 && iptables -I DOCKER-USER -p tcp -m conntrack --ctorigdstport 443 --ctdir ORIGINAL -j ACCEPT

57 * * * * sync && echo 3 > /proc/sys/vm/drop_caches
0 */3 * * * apk update && apk upgrade
5 3 * * * reboot

ddclient instant check

ddclient -daemon=0 -debug -verbose --foreground

References

https://wiki.alpinelinux.org/wiki/Zram
https://wiki.alpinelinux.org/wiki/Setting_up_disks_manually
https://github.com/bin456789/reinstall