libicui18n.so.52:无法打开共享库文件 [英] libicui18n.so.52: cannot open shared object file
问题描述
我一直在使用libicu在运行于docker ubuntu内部的节点应用程序中检测字符集。这是通过模块 node-icu-charset-detector 完成的,该模块使用 libicu-dev
软件包,该软件包在npm软件包之前安装。
I have been using libicu to detect charset in my node app that runs inside of docker, ubuntu. this is done through the module node-icu-charset-detector that uses the libicu-dev
package, which I install prior to the npm package.
一切正常,但我突然得到了错误
It all worked fine but I suddently get the error
module.js:356
Module._extensions[extension](this, filename); ^
Error: libicui18n.so.52: cannot open shared object file: No such file or directory
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/app/node_modules/node-icu-charset-detector/node-icu-charset-detector.js:1:82)
查看我的/ usr / lib /,没有找到任何与icu相关的东西,但是安装了libicu-dev。
Looking into my /usr/lib/, I don't find anything icu related, but libicu-dev is installed.
这是我的docker file;
This is my docker file;
# Pull base image.
FROM dockerfile/ubuntu
WORKDIR /
ADD run.sh /run.sh
#make dirs
RUN mkdir /log
RUN mkdir /app
RUN apt-get install -y supervisor libssl-dev pkg-config wget
# Install Node.js
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get install -y nodejs
# Append to $PATH variable.
RUN echo '\n# Node.js\nexport PATH="node_modules/.bin:$PATH"' >> /root/.bash_profile
ADD /supervisord.conf /etc/supervisor/conf.d/supervisord.conf
#get phantomJS
RUN apt-get install libfreetype6 libfontconfig -y
RUN cd /app
RUN npm install phantomjs &>/dev/null
#ICU
RUN apt-get install libicu-dev libicu48 -y
RUN npm install --loglevel silent &>/dev/null
RUN npm update --loglevel silent &>/dev/null
#GET NODE-Supervisor
RUN cd /
RUN npm install --loglevel silent -g supervisor
RUN chmod 755 /*.sh
CMD ["/run.sh"]
感谢您提供有关此问题的任何帮助,因为我对Linux的了解还很深:(
Thank you for any help regarding this issue, as I am at the end of my linux knowledge :(
推荐答案
如@ mscdex指出,libicu正在寻找libicu52软件包,以某种方式更新了存储库,这使我可以提取依赖于libicu52的新libicu,而libicu52在12.04的存储库中不可用,但在14.04中可用。由于Docker注册表中没有正式的受信任版本14.04,因此我制作了自己的基本 ubuntu14.04 docker映像,该映像以13.10开始并升级到14.04;
As @mscdex has pointed out, libicu was looking for the libicu52 package. Somehow the repository got updated allowing me to pull the new libicu which depends on libicu52 that isn't available in the repository of 12.04, but in 14.04. Since there is no official trusted build of 14.04 in the docker registry, I made my own "base" ubuntu14.04 docker image which starts with 13.10 and upgrades to 14.04;
FROM ubuntu:saucy
ENV DEBIAN_FRONTEND noninteractive
# Work around initramfs-tools running on kernel 'upgrade': <http://bugs.debian.org/cgi- bin/bugreport.cgi?bug=594189>
ENV INITRD No
# Update OS.
RUN sed -i 's/saucy/trusty/g' /etc/apt/sources.list
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get dist-upgrade -y
# Install basic packages.
RUN apt-get install -y software-properties-common
RUN apt-get install -y curl git htop unzip vim wget
# Add files.
ADD root/.bashrc /root/.bashrc
ADD root/.gitconfig /root/.gitconfig
ADD root/scripts /root/scripts
RUN apt-get clean
# Set working directory.
ENV HOME /root
WORKDIR /root
CMD ["/bin/bash"]
然后在我的工作人员的Dockerfile中,我安装了libicu52而不是libicu48,从而解决了所有问题
Then in the Dockerfile of my worker, I installed libicu52 instead of libicu48 thus fixing all issues
这篇关于libicui18n.so.52:无法打开共享库文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!