- 
                Notifications
    You must be signed in to change notification settings 
- Fork 177
Open
Description
When using a storage back end in docker that does not support extended file attributes, the go-dnsmasq resolver is not able to bind to port 53 (or any other port < 1024).
Basically the line https://github.com/smebberson/docker-alpine/blob/master/alpine-base/Dockerfile#L18 has no effect when such a storage back end (aufs, btrfs - see moby/moby#30557) is used, so DNS fails in the container.
I suggest a simple workaround in https://github.com/smebberson/docker-alpine/blob/master/alpine-base/root/etc/services.d/resolver/run like this:
#!/usr/bin/with-contenv sh
RUNAS="go-dnsmasq"
setcap -v CAP_NET_BIND_SERVICE=+eip /bin/go-dnsmasq
status=$?
if [ !$status ];
then
    RUNAS="root"
fi
s6-setuidgid ${RUNAS} go-dnsmasq --default-resolver --ndots "1" --fwd-ndots "0" --hostsfile=/etc/hosts >> $GO_DNSMASQ_LOG_FILE 2>&1
This makes go-dnsmasq run as root (instead of the go-dnsmasq user) if the capability is not set on the binary (which is the case when using a back end that does not support extended file attributes.
Metadata
Metadata
Assignees
Labels
No labels