0

我正在使用一个dind(docker中的docker)图像,并使用以下参数对其进行旋转,以便为dockerhub提供一个内部代理存储库

--insecure-registry=internalrepo.intra:5002 / 
--registry-mirror=https://dockerproxy.intra:5000

在 dind 容器中,这些似乎很好

/ # ps
PID   USER     TIME   COMMAND
    1 root       0:09 dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --insecure-registry=internalrepo.intra:5002 --registry-mirror=https://dockerproxy.intra:5000
   21 root       0:11 docker-containerd --config /var/run/docker/containerd/containerd.toml
  178 root       0:00 /bin/sh
  209 root       0:00 /bin/sh
  233 root       0:00 ps
/ #

但是,当我尝试提取图像时,此参数似乎被忽略了

 # docker pull jenkins/jnlp-slave
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
4

1 回答 1

2

错误消息令人困惑。问题不在于参数被忽略,而在于证书https://dockerproxy.intra:5000不受信任。因此,将各自的证书添加到图像的信任库中有助于克服亲

ARG CERT_PATH=/usr/local/share/ca-certificates
# add sc certificates to certificates location and update ca-certificates
ADD mycert.crt $CERT_PATH/mycert.crt
RUN update-ca-certificates
于 2019-01-31T11:41:10.063 回答