FROM base AS rootlesskit-src WORKDIR /usr/src/rootlesskit RUN git init . && git remote add origin 'https://github.com/rootless-containers/rootlesskit.git'

When updating, also update rootlesskit commit in vendor.mod accordingly.

ARG ROOTLESSKIT_VERSION=v1.1.0 ENV http_proxy=http://192.168.44.37:7890 ENV https_proxy=https://192.168.44.37:7890 RUN git fetch -q --depth 1 origin '${ROOTLESSKIT_VERSION}' +refs/tags/:refs/tags/ && git -c http.sslBackend=openssl http.postBuffer=524288000 checkout -q FETCH_HEAD

已经设置了http和https代理,并且设置了git -c http.sslBackend=openssl http.postBuffer为524288000,还是报错fatal: unable to access 'https://github.com/rootless-containers/rootlesskit.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.。不是已经改成了openssl了吗,为啥还是gnutls内容:_handshake()失败?

这可能是因为您的系统缺少OpenSSL库,而Git默认使用GnuTLS。您可以尝试安装OpenSSL库并重新构建Docker镜像,或者在Dockerfile中显式地指定使用OpenSSL:

RUN apt-get update && apt-get install -y libssl-dev
RUN git -c http.sslBackend=openssl fetch -q --depth 1 origin '${ROOTLESSKIT_VERSION}' +refs/tags/*:refs/tags/* && git -c http.sslBackend=openssl http.postBuffer=524288000 checkout -q FETCH_HEAD
Docker构建镜像时,解决`gnutls_handshake() failed: The TLS connection was non-properly terminated.`错误

原文地址: https://www.cveoy.top/t/topic/gRGc 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录