Ullaakut / RTSPAllTheThings

Deprecated RTSP media server -- Use github.com/aler9/rtsp-simple-server instead.
Apache License 2.0
278 stars 72 forks source link

docker multistage build #57

Closed molobrakos closed 6 years ago

molobrakos commented 6 years ago

Docker multistage build (https://docs.docker.com/develop/develop-images/multistage-build/)

Ullaakut commented 6 years ago

Ah so I see you did it with the ubuntu image for the build step, so the digest auth should still work right? Thanks again @molobrakos !

molobrakos commented 6 years ago

Yes. I kept the same base image as before to keep all functionality. I don't use digest myself, and I wanted a slimmer image, so I switched to the debian-slim base image in my repo.

Ullaakut commented 6 years ago

Tried it on my machine now and the size seems to have stayed pretty similar.

screenshot 2018-09-24 at 18 42 25

I'll export the image's contents into a tarball and take a look at what's big, but I suspect it's the binary unfortunately

Ullaakut commented 6 years ago

Actually it's gstreamer itself that is huge, and I'm not sure there's anything we can do about it unfortunately:

screenshot 2018-09-24 at 18 48 31
molobrakos commented 6 years ago

Using debian-slim as base-image, I get a size of 551MB.

Ullaakut commented 6 years ago

Yep, it seems ubuntu comes with way too many fat libraries. Using debian-slim would definitely be a better option, but we'd have to manually install gstreamer to have the up-to-date version of the library.

Ullaakut commented 6 years ago

So in the end I didn't find time to make a debian image work with the last version of gstreamer, so I'm not sure if I should leave this open in the meantime or not, as currently this PR doesn't achieve much since it's ubuntu instead of debian, it barely reduces the image size :/

molobrakos commented 6 years ago

Closing this for now then, thank you for your feedback! I'm using the debian base image myself, but I don't rely on authorization being enabled/available so the current version of gstreamer works fine.

Ullaakut commented 6 years ago

Hopefully we'll be able to reopen this soon with a newer version of gstreamer in the debian repos :)