Closed QuadStingray closed 4 months ago
By default, Google's open DNS server (8.8.8.8
) is used to resolve DNS queries. However, to resolve host.docker.internal
, you may need to use Docker's embedded DNS server within the nginx configuration, see:
https://github.com/weserv/images/issues/206#issuecomment-1752740666
To disable any caching, you can use the the imagesweserv-no-cache.conf
config, see:
https://github.com/weserv/images/issues/354#issuecomment-1221544455
The following Dockerfile combines these approaches:
# Usage: docker build --build-arg DNS_SERVER=127.0.0.11 -t weserv/images .
FROM ghcr.io/weserv/images:5.x
ARG DNS_SERVER=1.1.1.1
RUN cp ngx_conf/imagesweserv-no-cache.conf /etc/nginx/imagesweserv.conf \
&& sed -i "/resolver /s/[0-9].*/$DNS_SERVER;/" /etc/nginx/imagesweserv.conf
Thanks! 👍🏻
To set the DNS Server IP to 127.0.0.11 did not work for me. So I read the DNS Server now from /etc/resolv.conf
on server startup.
So just for Documentation and if someone else has the same Issue here my Dockerfile:
FROM ghcr.io/weserv/images:5.x
RUN rm -rf /etc/nginx/imagesweserv.conf \
&& cp ngx_conf/imagesweserv-no-cache.conf /etc/nginx/imagesweserv.conf
CMD DNS_SERVER=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}' | head) ;\
sed -i "/resolver /s/[0-9].*/$DNS_SERVER;/" /etc/nginx/imagesweserv.conf; \
nginx -g "daemon off;"
I want to host an Instance of
weserv/images
on my internal Kubernetes Cluster.How can I setup an instance without any domain limitations and DNS Server from device usage, for example on local device based development.
The curl doesn`t work with error.
If i connect to docker container this curl is working.
An other question is how to disable caching on my self hosted instance?
Thanks for your help!