Radek K
Radek K

Reputation: 179

Bash script that uses whois command gets "Servname not supported..." error on docker

It's my first Docker image, I put there my own bash script. This script uses the whois command. After docker runs my script, I have some errors. Probably I made mistake on my dockerfile. Script works well on my ubuntu. Should I add the /etc/services file to my image?

Dockerfile:

FROM ubuntu
ADD ./ip_info /usr/src/ip_info
ADD ./ip_info /bin/ip_info
RUN apt-get update &&  apt-get -y install whois
RUN chmod +x /usr/src/ip_info
CMD ["/usr/src/ip_info"]

error:

getaddrinfo(whois.ripe.net): Servname not supported for ai_socktype

Upvotes: 7

Views: 2623

Answers (1)

Radek K
Radek K

Reputation: 179

I fixed it by

RUN apt-get update && apt-get install -y --no-install-recommends ntp

to dockerfile.

Upvotes: 9

Related Questions