Whois with NodeJS Docker Image
I’m trying to get Whois working in NodeJS on a Dockerfile. I’m using Whois-UX (which just spawns a whois process with the
whois linux command. I’m using the “node:argon” docker image, but it doesn’t have whois installed. There doesn’t seem to be a way to
apt-get install whois inside the image either.
I then tried to use “ubuntu:12.04″, but I’m having trouble running the app with it. Here is my 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"]
So, there are two possible solutions that I don’t know how to solve. Figure out how to get whois on the node:argon image, or get the ubuntu docker image to work. I’d rather get whois on node:argon, because of optimizations for NodeJS, but as long as it works, it’ll do.
Thanks for the help!
One Solution collect form web for “Whois with NodeJS Docker Image”
Whelp. I got it.
I forgot to
apt-get update before I
apt-get installed whois, so it didn’t show the repository as being up.
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"]
^ This worked.