OS Version: Centos7 or Debian12
Docker Version: 26.x +
1. /etc/Docker/daemon.json (myself hub is http site)
{
"insecure-registries": ["10.134.162.250"],
"log-driver": "json-file",
"live-restore": true,
"log-opts": {"max-size": "100m", "max-file": "7"}
}
2. Dockerfile
FROM 10.134.162.250/proxy/library/alpine AS build
RUN apk update && apk add pcre-dev zlib-dev build-base wget && \
cd /root && \
wget nginx-1.25.1.tar.gz && \
wget headers-more-nginx-module-0.34.tar.gz && \
tar -zxvf nginx-1.25.1.tar.gz && \
tar -zxvf headers-more-nginx-module-0.34.tar.gz && \
cd nginx-1.25.1 && \
./configure --prefix=/usr/local/nginx --with-compat --add-dynamic-module=/root/headers-more-nginx-module-0.34 && \
make && make install && \
ls /usr/local/nginx/modules/ngx_http_headers_more_filter_module.so
FROM 10.134.162.250/proxy/library/nginx:1.25.1-alpine
COPY --from=build /usr/local/nginx/modules/ngx_http_headers_more_filter_module.so /usr/lib/nginx/modules/
3. docker cli
3.1 When I execute “ docker build . -t test ” the result is failed,The failure message is “… failed to do request: Head "https://10.134.162.250/v2 …”
3.2 When I execute " docker pull 10.134.162.250/proxy/library/alpine " the result is successful
3.3 Why docker build access https site? or Why docke build not use ’ “insecure-registries”: [“10.134.162.250”] ‘
