Docker Community Forums

Share and learn in the Docker community.

Shared library error when 'make' in build, but compiles fine when I run the image

Hi,

I am trying to build a docker image, and one of the required libraries is MeCab. This library contains two parts, the software itself and the dictionary. When I tried to build a docker image using docker build, I get the following error message:

/usr/local/libexec/mecab/mecab-dict-index: error while loading shared libraries: libmecab.so.2: cannot open shared object file: No such file or directory

libmecab.so.2 is part of the software which is already make and make install, but when I tried to make the dictionary, it cannot find the above library. If I stop the docker build at the RUN step before this error, docker run the built image, then run the same make command, it works… so the libmecab.so.2 is definitely properly installed, but for some reason docker build can’t find it…?

Any suggestions would be much appreciated, thanks!

Hi buddy, try to build the loops after the gaps it should work well then.

Hi, sorry not sure what you mean by loops and gaps, could you please explain?

Hi @dannycheng and @nodrojelmo ,
I am facing the same problem, can you please give some advices.