just-containers / s6-overlay

s6 overlay for containers (includes execline, s6-linux-utils & a custom init)
Other
3.73k stars 212 forks source link

v3 and disable legacy services #573

Closed yvess closed 6 months ago

yvess commented 6 months ago

I using the new v3 s6 overlay version, in some of my newer containers. I'm a longtime s6 user and quite happy with it thanks! I wanted to go full in with the new v3 version, and didn't want to have legacy stuff in my container, when I don't use it. A part that makes s6 attractive is that's lean without needed bulk!

So should there be a noarch tar without legacy or a bit more documentation (could add a PR for that)?

This is how I currently solve it in my docker container when I don't need the legacy services. Busybox tar unfortunately doesn't support more advanced glob patterns like "**".

# Dockerfile
FROM alpine:3

# s6 overlay
ARG S6_OVERLAY_VERSION=v3.1.6.2
ENV PATH="${PATH}:/command"
RUN wget -q -O - https://github.com/just-containers/s6-overlay/releases/download/$S6_OVERLAY_VERSION/s6-overlay-noarch.tar.xz | \
    xzcat | tar x  --exclude=./*/*/*/*/*/*/*/*/legacy-cont-init  --exclude=./*/*/*/*/*/*/legacy-cont-init --exclude=./*/*/*/*/*/*/legacy-services --exclude=./*/*/*/*/*/*/*/*/legacy-services -C /
RUN wget -q -O - https://github.com/just-containers/s6-overlay/releases/download/$S6_OVERLAY_VERSION/s6-overlay-x86_64.tar.xz | \
    xzcat | tar x -C /

ENTRYPOINT ["/init"]
skarnet commented 6 months ago

Hi! I appreciate the compliment.

Lots of users, however, are relying on the legacy services, so there are no plans to get rid of the infrastructure supporting them at the moment. And it wouldn't be a good use of our time to maintain two versions of s6-overlay, one with legacy service support and the other one without.

Don't worry, the amount of time and disk space used by the feature is simply not noticeable. If you have no legacy services, then the s6-rc service that is activating them takes no time or resources at all.

If it's still bothering you, though, you could disable them from the database, by having a S6_STAGE2_HOOK script that removes the /etc/s6-rc/sources/top/contents.d/base and /etc/s6-rc/sources/top/contents.d/legacy-services files. Please note, however, that we provide no support for modified s6-overlay images.

yvess commented 6 months ago

Yes true I could also use the S6_STAGE2_HOOK to remove them. I was more bothered by the console log output of the legacy services, even when I don't use them.

Perhaps another option could be to have S6_DISABLE_LEGACY env var. Don't know if you want to get rid of the legacy services in v4 or later. This could be the first step in that direction.

skarnet commented 6 months ago

If v4 happens some day, it will be a significant evolution from v3, legacy will disappear, and there will be a more dynamic configuration mechanism. So don't worry about it. 😉