Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

bash

docker

whois

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
like image 956
Radek K Avatar asked Jun 03 '19 15:06

Radek K


1 Answers

I fixed it by

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

to dockerfile.

like image 198
Radek K Avatar answered Oct 12 '22 14:10

Radek K