Hi,
the busybox
binary also includes an nslookup
applet, so the instructions above can be used to also get nslookup
in your container, you just need to call it like this then:
# busybox nslookup
BusyBox v1.30.1 (Debian 1:1.30.1-6+b3) multi-call binary.
Usage: nslookup [-type=QUERY_TYPE] [-debug] HOST [DNS_SERVER]
Query DNS about HOST
QUERY_TYPE: soa,ns,a,aaaa,cname,mx,txt,ptr,any
The extra_hosts
section you posted is syntactically correct:
mattermost:
[...]
volumes:
[...]
- /bin/busybox:/bin/busybox:ro
extra_hosts:
- "somehost:1.2.3.4"
This will add the busybox binary to the container and also create the hosts file entry:
# docker exec -ti mm-770-mattermost-1 busybox ping somehost
PING somehost (1.2.3.4): 56 data bytes
ping: permission denied (are you root?)
# docker exec -ti mm-770-mattermost-1 busybox nslookup mattermost.com 1.1.1.1
Server: 1.1.1.1
Address: 1.1.1.1:53
Non-authoritative answer:
Name: mattermost.com
Address: 141.193.213.20
Name: mattermost.com
Address: 141.193.213.21
Non-authoritative answer: