Dockerfile 中使用 CRIU 时的证书校验问题解决
FROM base AS criu
ARG DEBIAN_FRONTEND
使用 --insecure 参数禁用 SSL/TLS 证书校验
ADD --insecure --chmod=0644 https://download.opensuse.org/repositories/devel:/tools:/criu/Debian_11/Release.key /etc/apt/trusted.gpg.d/criu.gpg.asc
RUN --mount=type=cache,sharing=locked,id=moby-criu-aptlib,target=/var/lib/apt
--mount=type=cache,sharing=locked,id=moby-criu-aptcache,target=/var/cache/apt
echo 'deb https://download.opensuse.org/repositories/devel:/tools:/criu/Debian_11/ /' > /etc/apt/sources.list.d/criu.list
&& apt update
&& apt install -y --no-install-recommends criu
&& install -D /usr/sbin/criu /build/criu
注意: 禁用证书校验可能会存在安全风险,建议在可信的环境中使用。
原文地址: https://www.cveoy.top/t/topic/gTa9 著作权归作者所有。请勿转载和采集!