Sign in to follow this  
ogi

How would I go about compiling mkclean with static libraries

2 posts in this topic Last Reply

Recommended Posts

So I'm not sure if this is the correct place for this post, so apologies in advance if I should have posted this elsewhere.

 

My question in short is, how would I go about compiling the mkclean with static libraries?  Longer explanation with some context below.

 

mkclean, is one of several tools that can be used to cleanup and optimize matroska based video containers.  They include some other utilities that are handy as well here: https://github.com/Matroska-Org/foundation-source

 

I thought I would attempt to use the mkclean binary package specifically as part of a post-processing script within a docker container.

 

With the assistance of the devpack plugin I was able to compile the matroska utilities from source.  The problem is that I cannot execute the binaries from within a docker container.  I suspect the reason that's not possible is due to dynamically linked libraries:

 

root@4bb49dcb91f6:/utils$ ldd mkclean
	/lib64/ld-linux-x86-64.so.2 (0x14d447b80000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x14d44782e000)
	libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x14d447b80000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x14d44761c000)
	libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x14d447b80000)
root@4bb49dcb91f6:/utils$ ls /lib64
ls: cannot access '/lib64': No such file or directory
root@4bb49dcb91f6:/utils$ ls /usr/lib64/
ls: cannot access '/usr/lib64/': No such file or directory
root@4bb49dcb91f6:/utils$ ls /lib64
ls: cannot access '/lib64': No such file or directory
root@4bb49dcb91f6:/utils$

Of course, from within unraid, the binary executes just fine.

 

So, I suppose this means I need to build mkclean (and the other binaries I want to use) from source, but with statically linked libraries; so how would I go about that?

 

Thanks!

Share this post


Link to post

After talking this over with some friends; I got help creating a custom docker build file:

 

```

FROM alpine

RUN apk add --update git build-base openssh
WORKDIR /app/
RUN git clone https://github.com/Matroska-Org/foundation-source.git
WORKDIR /app/foundation-source/
RUN gcc corec/tools/coremake/coremake.c -o coremake
RUN ./coremake gcc_linux_x64
RUN make -C spectool
RUN make -C mkvalidator
RUN make -C mkclean


FROM linuxserver/nzbget 

COPY --from=0 /app/foundation-source/release/gcc_linux_x64/mkclean /usr/bin/
```

 

I created a dockerhub repo in case anyone is curious or wants to try it out here:

 

https://hub.docker.com/r/j9ac9k/nzbget_mktools/

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Copyright © 2005-2018 Lime Technology, Inc.
unRAID® is a registered trademark of Lime Technology, Inc.