Mua hàng tại Link Shopee hoặc Hotline 0345-148-136.

Alpine Linux jail on FreeBSD

I’m trying to install mail server on FreeBSD but I don’t want postfix+dovecot which is overkill for me.

So I have 2 solutions:

  • maddy – ✉️ Composable all-in-one mail server
  • Stalwart Mail Server – Secure & Modern All-in-One Mail Server (IMAP, JMAP, SMTP) 🛡️

Unfortunately, those apps are not available on FreeBSD so I will install them on Alpine Linux jail.

To run Alpine Linux jail on FreeBSD:

Load required kernel modules. Use loader.conf(5) if you want to load them at startup.

kldload linux linux64 fdescfs tmpfs linprocfs linsysfs pty

Create the jail with Alpine Linux (you need appjail0 which is a loopback interface, see docs for details):

appjail makejail -j alpine -f gh+AppJail-makejails/alpine-linux \
    -o template=/usr/local/share/examples/appjail/templates/linux.conf \
    -o alias \
    -o virtualnet=":appjail0 default" \
    -o nat

Install OpenRC

appjail cmd jexec alpine apk add openrc

Change the of exec.start to /sbin/openrc

appjail-config set -j alpine exec.start=/sbin/openrc

Restart Alpine Linux jail

appjail restart alpine

Create a dummy file to indicate to OpenRC that you want to use it even if it is not fully supported

appjail cmd jexec alpine touch /run/openrc/softlevel

Fix OpenRC network interfaces in jail: edit /etc/rc.conf

rc_provide="loopback net"

Comments

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *