Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Dockerfile to create smaller image #4

Closed
izderadicka opened this issue Jan 1, 2019 · 3 comments
Closed

Change Dockerfile to create smaller image #4

izderadicka opened this issue Jan 1, 2019 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@izderadicka
Copy link
Owner

Current Dockerfile creates image with size over 2GB. It's just too much!

Try to come with something smaller - using Ubuntu as base is not efficient, majority of things is just not needed.
audioserve compiles to one binary plus two additional files are needed (index.html and bundle.js for web client).
audioserve depends on few dynamic libraries:

ldd /opt/audioserve/audioserve
	linux-vdso.so.1 =>  (0x00007ffdd6df4000)
	libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f848886f000)
	libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f8488492000)
	libtag_c.so.0 => /usr/local/lib/libtag_c.so.0 (0x00007f8488289000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8488085000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f8487e7d000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8487c5f000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8487a49000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8487680000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f8489219000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f848737a000)
	libtag.so.1 => /usr/local/lib/libtag.so.1 (0x00007f8486fc9000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8486cc5000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f8486aac000)

Try complely static build with musl libc? Then it can use alpine linux?

@izderadicka izderadicka added enhancement New feature or request help wanted Extra attention is needed labels Jan 1, 2019
@izderadicka
Copy link
Owner Author

I've tried static build for now I'm sucked with problem to statically linked taglib with rust code - see the issue here emk/rust-musl-builder#65. If anybody has some ideas please help.

@izderadicka
Copy link
Owner Author

Current Dockerfile creates image with size over 2GB.

Just to mention that current multistage Dockerfile helped significantly - so it's now ~ 200MB (with 60MB static ffmpeg executable). I'm keeping this opened as there are still possible improvements.

Especially interesting could be a statically linked executable. But there I got stuck, as noted above - static linking with C++ libraries looks like a problem in Rust.

@izderadicka
Copy link
Owner Author

Closing because current Docker image is now OKish, further improvement will require static compilation, for which I created separate issue #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant