From d2747d0937c676f5a28af6ea50f5130081ce0a74 Mon Sep 17 00:00:00 2001 From: Nianyu Shen Date: Mon, 18 Nov 2024 22:36:49 -0800 Subject: [PATCH 1/2] fix: copy cert in dockerfile Signed-off-by: Nianyu Shen --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4f8efb0..b76e681 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,19 +7,19 @@ ARG HTTP_PROXY ARG HTTPS_PROXY ARG NO_PROXY -WORKDIR /certs +RUN mkdir -p /certs COPY certs/ /certs/ RUN if [ "${OS_DISTRIBUTION}" = "ubuntu" ]; then \ - cp -f /certs/* /usr/local/share/ca-certificates/ && \ + cp -a /certs/. /usr/local/share/ca-certificates/ && \ update-ca-certificates; \ fi RUN if [ "${OS_DISTRIBUTION}" = "opensuse-leap" ]; then \ - cp -f /certs/* /usr/share/pki/trust/anchors/ && \ + cp -a /certs/. /usr/share/pki/trust/anchors/ && \ update-ca-certificates; \ fi RUN if [ "${OS_DISTRIBUTION}" = "rhel" ]; then \ - cp -f /certs/* /etc/pki/ca-trust/source/anchors/ && \ + cp -a /certs/. /etc/pki/ca-trust/source/anchors/ && \ update-ca-trust; \ fi RUN rm -rf /certs From cda6a0414d455e3db46d3ce727c5d8c5030ecf08 Mon Sep 17 00:00:00 2001 From: Nianyu Shen Date: Wed, 27 Nov 2024 20:50:33 -0800 Subject: [PATCH 2/2] fix: accept cert without proxy Signed-off-by: Nianyu Shen --- earthly.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthly.sh b/earthly.sh index d28c922..abcb8b6 100755 --- a/earthly.sh +++ b/earthly.sh @@ -115,7 +115,7 @@ if ! docker run --rm --privileged $ALPINE_IMG sh -c 'echo "Privileged container echo "Privileged containers are not allowed for the current user." exit 1 fi -if [ -z "$HTTP_PROXY" ] && [ -z "$HTTPS_PROXY"]; then +if [ -z "$HTTP_PROXY" ] && [ -z "$HTTPS_PROXY" ] && [ -z "$(find certs -type f ! -name '.*' -print -quit)" ]; then build_without_proxy "$@" else build_with_proxy "$@"