docker: make dockerfile build from local source
This commit is contained in:
27
Dockerfile
27
Dockerfile
@@ -1,18 +1,17 @@
|
|||||||
FROM debian:buster-slim
|
FROM ubuntu:latest as smartdns-builder
|
||||||
|
|
||||||
RUN apt update && \
|
COPY . /smartdns/
|
||||||
apt install -y git make gcc libssl-dev && \
|
RUN apt update && \
|
||||||
git clone https://github.com/pymumu/smartdns.git --depth 1 && \
|
apt install -y make gcc libssl-dev && \
|
||||||
cd smartdns && \
|
cd smartdns && \
|
||||||
sh ./package/build-pkg.sh --platform debian --arch `dpkg --print-architecture` && \
|
sh ./package/build-pkg.sh --platform debian --arch `dpkg --print-architecture`
|
||||||
dpkg -i package/*.deb && \
|
|
||||||
cd / && \
|
|
||||||
rm -rf smartdns/ && \
|
|
||||||
apt autoremove -y git make gcc libssl-dev && \
|
|
||||||
apt clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
EXPOSE 53/udp
|
FROM ubuntu:latest
|
||||||
VOLUME "/etc/smartdns/"
|
COPY --from=smartdns-builder /smartdns/package/*.deb /opt/
|
||||||
|
RUN dpkg -i /opt/*.deb && \
|
||||||
|
rm /opt/*deb -fr
|
||||||
|
|
||||||
CMD ["/usr/sbin/smartdns", "-f"]
|
EXPOSE 53/udp
|
||||||
|
VOLUME "/etc/smartdns/"
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/smartdns", "-f", "-x"]
|
||||||
|
|||||||
@@ -1458,7 +1458,7 @@ static struct dns_ptr *_dns_conf_get_ptr(const char *ptr_domain)
|
|||||||
key = hash_string(ptr_domain);
|
key = hash_string(ptr_domain);
|
||||||
hash_for_each_possible(dns_ptr_table.ptr, ptr, node, key)
|
hash_for_each_possible(dns_ptr_table.ptr, ptr, node, key)
|
||||||
{
|
{
|
||||||
if (strncmp(ptr->ptr_domain, ptr_domain, DNS_MAX_CNAME_LEN) != 0) {
|
if (strncmp(ptr->ptr_domain, ptr_domain, DNS_MAX_PTR_LEN) != 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user