# Docker and shared library loading problem

**URL:** <https://discourse.julialang.org/t/docker-and-shared-library-loading-problem/41807>\
**Category:** New to Julia\
**Created:** [June 21, 2020, 8:46am UTC](https://discourse.julialang.org/t/docker-and-shared-library-loading-problem/41807 "2020-06-21T08:46:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [June 21, 2020, 8:46am UTC](https://discourse.julialang.org/t/docker-and-shared-library-loading-problem/41807/1 "2020-06-21T08:46:14Z")

</div>

I’m running Julia in Docker container built from `ubuntu` image with Julia executable on top. Everything runs fine except of loading shared library. Here is the log:

```julia
paul@desktop:~$ docker run -it julia
root@1c3ef9183e75:/# julia $JULIA_PATH/subt.jl
ERROR: LoadError: could not load library "/usr/lib/libsimc.so"
libsubt_communication_client.so: cannot open shared object file: No such file or directory
....
root@1c3ef9183e75:/# find / -name libsimc.so
/usr/lib/libsimc.so

```

The loader complains that `/usr/lib/libsimc.so` file doesn’t exist, but the file is there as evidenced by the next command. Trying to call a function needing this library from the REPL results in the same problem.

The same tests run just fine outside of Docker.

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [June 21, 2020, 9:02am UTC](https://discourse.julialang.org/t/docker-and-shared-library-loading-problem/41807/2 "2020-06-21T09:02:23Z")

</div>

> [@pauljurczak](#):
>
> ```julia
> ERROR: LoadError: could not load library "/usr/lib/libsimc.so"
> libsubt_communication_client.so: cannot open shared object file: No such file or directory
> 
> ```

It is because it cannot find `libsubt_communication_client.so`, a dependent library. Check for this file instead (`find / -name libsubt_communication_client.so`).

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [June 21, 2020, 9:11am UTC](https://discourse.julialang.org/t/docker-and-shared-library-loading-problem/41807/3 "2020-06-21T09:11:31Z")

</div>

> [@tomaklutfu](#):
>
> it cannot find `libsubt_communication_client.so` , a dependent library

Thank you. That was the problem.

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [June 21, 2020, 10:00am UTC](https://discourse.julialang.org/t/docker-and-shared-library-loading-problem/41807/5 "2020-06-21T10:00:38Z")

</div>

BTW, what is loader’s search path? `LD_LIBRARY_PATH`?

---

<div class="post-metadata">

**Author:** ![tomaklutfu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomaklutfu/32/2411_2.png) [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Post date:** [June 21, 2020, 10:14am UTC](https://discourse.julialang.org/t/docker-and-shared-library-loading-problem/41807/6 "2020-06-21T10:14:53Z")

</div>

According to [this page](https://docs.julialang.org/en/v1/stdlib/Libdl/#), `Base.DL_LOAD_PATH` is used first, then the system’s load path searched so you can push the dynamic library paths to the `DL_LOAD_PATH`. I think `LD_LIBRARY_PATH` is ignored at the moment.
