在docker镜像中安装mongoimport
从我的节点脚本我需要通过exec
从child_process
函数执行child_process
。 在Docker镜像中的CItesting中遇到了一个问题:
/bin/sh: 1: mongoimport: not found
现在我在drone.yml文件中插入了mongodb的安装:
- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 - echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.2 main" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list - apt-get update - apt-get install -d -y mongodb-org-tools
但是仍然没有findmongoimport。 我甚至添加了根/
到PATHvariables或做了一个
find / -name "mongoimport"
没有。
有没有人有一个想法,如何让mongoimport在docker形象工作?
谢谢。
PS .:以下是apt-get的输出:
$ apt-get install -d -y mongodb-org-tools Reading package lists... Building dependency tree... Reading state information... The following NEW packages will be installed: mongodb-org-tools 0 upgraded, 1 newly installed, 0 to remove and 102 not upgraded. Need to get 31.4 MB of archives. After this operation, 135 MB of additional disk space will be used. Get:1 http://repo.mongodb.org/apt/debian/ jessie/mongodb-org/3.2/main mongodb-org-tools amd64 3.2.14 [31.4 MB] Fetched 31.4 MB in 1s (28.2 MB/s) Download complete and in download only mode
解决:我试图安装错误的软件包。
- apt-get install -d -y mongodb-org-tools
一定是
- apt-get install -y mongodb-org
然后自动将mongodb-org工具与其他一些软件包一起安装。 现在可以使用mongoimport
$ find / -name "mongoimport" -ls > out.txt $ cat out.txt 2038 10588 -rwxr-xr-x 1 root root 10839312 Jun 13 22:30 /usr/bin/mongoimport