mumble-voip / mumble-docker

The official Mumble Docker image
BSD 3-Clause "New" or "Revised" License
127 stars 33 forks source link

Make use of docker-slim #25

Open Krzmbrzl opened 1 year ago

Krzmbrzl commented 1 year ago

See https://github.com/docker-slim/docker-slim

This seems to represent a viable option to further reduce our image's size.

azlux commented 1 year ago

Do mumble have some dynamic lib load ? I think qt have dynamic load.

Krzmbrzl commented 1 year ago

Idk - I just figured it might be worth a try to see if we can further reduce the image's size :shrug:

maweil commented 7 months ago

FYI: I have worked on another solution (manually building a distroless container for mumble) which is still WIP (only tested it with SQLite so far) in my fork of this repo.

I replaced the entrypoint.sh script with a custom built binary built in Rust (still learning it) to get rid of the shell and copied over the required shared libraries from a compatible debian image. It's not yet fully compatible with the official image here (I disabled some features I personally didn't need).

Once I have rebuilt it with the same feature set as the official build, I'll open a PR here.

maweil commented 7 months ago

Do mumble have some dynamic lib load ? I think qt have dynamic load.

Yes, the database drivers are loaded at runtime. Running ldd on the mumble-server binary does not show them.

murlakatamenka commented 7 months ago

Did you guys consider using Alpine?

Something as simple as this:

FROM alpine:3.19

ENV USER murmur
ENV PORT 64738

RUN adduser ${USER} \
    -DHs /sbin/nologin

RUN apk add --no-cache murmur

RUN mkdir /data && \
    chown -R ${USER}:${USER} /data

COPY --chown=${USER}:${USER} ./murmur.ini /data/murmur.ini

VOLUME /data

EXPOSE ${PORT}/tcp
EXPOSE ${PORT}/udp

USER ${USER}
CMD [ "/usr/bin/murmurd", "-ini", "/data/murmur.ini", "-fg"  ]

generates sub 70 MiB image, pretty good.

There are plenty of Alpine-based images on Dockerhub and on Github.

And you can always have a separate tag for Alpine.

Krzmbrzl commented 7 months ago

Yes we did but there is no support for ZeroC Ice on Alpine (last time I checked at least) which the server uses as a RPC framework.

murlakatamenka commented 6 months ago

@Krzmbrzl I see, indeed.

For me it's an okay tradeoff to use a smaller image without ZeroC Ice. Separate tag like mumble-server:alpine with notice about not supporting ZeroC Ice can be an option.


mumble is the first project I see that uses that zeroc. Even in Arch repos I see it being used only for mumble:

https://archlinux.org/packages/extra/x86_64/zeroc-ice/ -> See Required by

It gotta be pretty legacy, all the cool kids use web interfaces now, right? Or unix sockets etc. Also docs for interfacing via pretty confusing, but that's another issue.

Krzmbrzl commented 6 months ago

Could be done, yeah but would make things for us here more complicated. Not sure this would really be worth it 🤔