Johni0702 / mumble-web-proxy

Mumble to WebSocket+WebRTC proxy for use with mumble-web
70 stars 25 forks source link

Dockerize application using multi-stage builds #9

Closed LeoVerto closed 3 years ago

LeoVerto commented 4 years ago

I've written a Dockerfile to build an image based on rust-slim. I haven't tested this yet as I'm having trouble building the docker image for the webrtc branch of mumble-web right now.

One thing I'm a bit unhappy about is the current image size of 850MB, a lot of that seems to be due to the libnice dependency that pulls in a bunch of other apt packages including - for some reason - python.

I spent some time trying to get an image continuing only a statically linked binary to work but ultimately failed, possibly due to my inexperience with rust.

JuniorJPDJ commented 3 years ago

Oh, just saw this.. I opened #24 yesterday.

libnice dependency that pulls in a bunch of other apt packages including - for some reason - python.

Try disabling installation of recommended packages in APT or use alpine.

haslersn commented 3 years ago

I made a mumble-web-proxy Docker container of size 25.75 MiB.

JuniorJPDJ commented 3 years ago

@haslersn would you like to do pull request with it? You may also add example docker-compose.

haslersn commented 3 years ago

@JuniorJPDJ I can do so. Do you know if there's a more clean way to do this?

RUN echo -e '\n[dependencies."async-trait"]\ndefault-features = false' >> Cargo.toml

(It's required because I had to use RUSTFLAGS="-C target-feature=-crt-static" which in turn I had to use because of a problem with dynamically linking libclang.)

JuniorJPDJ commented 3 years ago

Unfortunately no, but I'll leave it, it doesn't seem very bad.

ricardojlrufino commented 3 years ago

I made a mumble-web-proxy Docker container of size 25.75 MiB.

Please push to docher hub...

JuniorJPDJ commented 3 years ago

or add pull request here with it ;)

haslersn commented 3 years ago

I didn't add a PR, yet, because I didn't have time to create your requested docker-compose example.

https://hub.docker.com/r/haslersn/mumble-web-proxy

ricardojlrufino commented 3 years ago

I didn't add a PR, yet, because I didn't have time to create your requested docker-compose example.

https://hub.docker.com/r/haslersn/mumble-web-proxy

@haslersn do you have the docker commands to make the set (3 containers) work? I'm trying but it doesn't work.

JuniorJPDJ commented 3 years ago

@haslersn just add Dockerfile, compose can go later or someone else could add it (eg. me if I had time)

LeoVerto commented 3 years ago

This PR has been improved on by #29 and thus made redundant.