containerized leafnode?
Matěj Cepl via leafnode-list <[email protected]> Sat, 18 May 2024 17:42:50 +0200
| Newsgroups | gmane.network.leafnode |
|---|---|
| Message-ID | <[email protected]> |
--===============1060247219180514213==
Content-Type: multipart/signed;
boundary=ca9fffda9f001f7b44cf09b28a9300dd76447c582abf5fc609e6dbebdcde;
micalg=pgp-sha1; protocol="application/pgp-signature"
Content-Transfer-Encoding: quoted-printable
--ca9fffda9f001f7b44cf09b28a9300dd76447c582abf5fc609e6dbebdcde
Content-Type: multipart/mixed;
boundary=d070b26b7d5883e116f3fc57e900cb5aac35b93a13759b9dffdad63a828a
--d070b26b7d5883e116f3fc57e900cb5aac35b93a13759b9dffdad63a828a
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Content-Type: text/plain; charset=UTF-8
(also posted as https://gitlab.com/leafnode-2/leafnode-2/-/merge_requests/5=
)
Hi,
I have moved my working computer to MicroOS [1], respectively
its desktop version using Sway called Moldavite [2]. The point
of the system is that it is minimal and the root partition (most
everything outside of /home) is read-only. All (or as much as
possible) software on the system is supposed to be run from
containers, be it Docker/Podman containers, Flatpak applications,
or other systems using Distrobox [3].
Of course, I haven=E2=80=99t found any leafnode containers (are there
any? I haven=E2=80=99t found anything), so I am trying to create one. If
anybody know about any other attempt to do so, please, let me
know. I would love to get comments on what I am trying to do here.
So, this is my Dockerfile:
# Define the names/tags of the container
#!BuildTag: opensuse/leafnode:latest opensuse/leafnode:%PKG_VERSION% op=
ensuse/leafnode:%PKG_VERSION%.%RELEASE%
FROM opensuse/tumbleweed:latest
# Define labels according to https://en.opensuse.org/Building_derived_c=
ontainers
# labelprefix=3Dorg.opensuse.example
LABEL io.containers.autoupdate=3D"registry"
LABEL org.opencontainers.image.authors=3D"Mat=C4=9Bj Cepl <[email protected]=
u>"
LABEL org.opencontainers.image.title=3D"opensuse/leafnode"
LABEL org.opencontainers.image.description=3D"Container for leafnode da=
emon"
LABEL org.opencontainers.image.version=3D"%PKG_VERSION%.%RELEASE%"
LABEL org.opensuse.reference=3D"registry.opensuse.org/opensuse/leafnode=
:%PKG_VERSION%.%RELEASE%"
LABEL org.openbuildservice.disturl=3D"%DISTURL%"
LABEL org.opencontainers.image.created=3D"%BUILDTIME%"
EXPOSE 25/tcp
EXPOSE 465/tcp
EXPOSE 587/tcp
# Set default values
VOLUME /var/spool/leafnode
VOLUME /var/spool/vmail
VOLUME /etc/leafnode
RUN zypper --non-interactive in openSUSE-release-appliance-docker \
leafnode procmail \
&& zypper clean -a
ENTRYPOINT /usr/sbin/leafnode
Couple of notes:
1. Ignore those LABELs, it is needed for containers on
registry.opensuse.org (it is available via `podman pull
registry.opensuse.org/home/mcepl/moldavite/containers/opensuse/leafnode:=
latest`).
2. Yes, I use OpenSUSE packages, but the resulting container
should be distro-independent and useable anywhere
Docker/Podman is available. If I have any SUSEism in the
resulting container, let me know.
3. This is meant for rootless podman, so this should run as a
normal user. Is it possible with leafnode (obviously, it
should use port > 1024)?
MicroOS uses for orchestration Podman, systemd, and quadlets [4],
so this my suggested .container file:
[Unit]
Description=3DPodman container-leafnode.service
Documentation=3Dman:leafnode(8)
Wants=3Dnetwork-online.target
After=3Dnetwork-online.target
[Container]
Image=3Dregistry.opensuse.org/home/mcepl/moldavite/containers/opensuse/=
leafnode:latest
ContainerName=3Dleafnode
AutoUpdate=3Dregistry
Environment=3DPUID=3D1000 PGID=3D100 TZ=3DEurope/Prague
Volume=3D%h/.config/leafnode:/etc/leafnode
Volume=3D%h/.local/share/leafnode/spool:/var/spool/leafnode
# Volume=3D%h/.local/share/leafnode/mail:/var/spool/vmail
PublishPort=3D127.0.0.1:9119:9119
UserNS=3Dkeep-id:uid=3D1000,gid=3D100
PodmanArgs=3D--hostname my-leafnode --privileged
[Service]
Restart=3Don-failure
[Install]
WantedBy=3Ddefault.target
Does anybody has any comments on all this?
Thank you in advance for any response,
Mat=C4=9Bj
[1] https://get.opensuse.org/microos/
[2] https://sr.ht/~mcepl/moldavite/
[3] https://github.com/89luca89/distrobox
[4] for example https://mo8it.com/blog/quadlet/
--=20
http://matej.ceplovi.cz/blog/, @mcepl-ZvyNPa7Jd/[email protected]
GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8
=20
England is governed not by logic but by parliament.
-- Benjamin Disraeli
--d070b26b7d5883e116f3fc57e900cb5aac35b93a13759b9dffdad63a828a--
--ca9fffda9f001f7b44cf09b28a9300dd76447c582abf5fc609e6dbebdcde
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iGwEABECACwWIQSJ70vGKIq/QxurJcPgn+8l2WSErAUCZkjMew4cbWNlcGxAY2Vw
bC5ldQAKCRDgn+8l2WSErPZUAKCEvtTvon2XU74LVjQYj8jqMfA4TgCeOwhWBKR0
wKvp73dFwbV5SEGrBUM=
=P4ph
-----END PGP SIGNATURE-----
--ca9fffda9f001f7b44cf09b28a9300dd76447c582abf5fc609e6dbebdcde--
--===============1060247219180514213==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline