Whois with NodeJS Docker Image

时间:2016-04-12 19:15:01

标签: node.js ubuntu docker dockerfile

我正在尝试让Whois在Dockerfile上使用NodeJS。我正在使用Whois-UX(它只使用whois linux命令生成一个whois进程。我正在使用“node:argon”docker镜像,但它没有安装whois。似乎也是图像中apt-get install whois的一种方式。

然后我尝试使用“ubuntu:12.04”,但我无法使用它运行应用程序。这是我的Dockerfile:

FROM ubuntu:12.04
WORKDIR /srv
ADD . /srv
RUN apt-get update
RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup | bash -
RUN apt-get install -y nodejs git git-core whois
RUN npm install
CMD ["node /srv/server.js"]

所以,有两种可能的解决方案,我不知道如何解决。弄清楚如何在节点上获取whois:氩图像,或者让ubuntu docker图像工作。我宁愿在节点上获取whois:氩气,因为NodeJS的优化,但只要它有效,它就会这样做。

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

雏龙。我懂了。

我在apt-get update编辑whois之前忘记了apt-get install,因此它没有显示存储库已启动。

FROM node:argon
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

RUN apt-get update
RUN apt-get install whois

RUN npm install bower -g

COPY package.json /usr/src/app/
RUN npm install

COPY . /usr/src/app
RUN bower install --allow-root

CMD ["npm", "start"]

^这很有效。