From fb25d3b5decbe1ef9a2312972e6e2ca47ddb7144 Mon Sep 17 00:00:00 2001 From: Lisan Chen Date: Tue, 26 Sep 2023 15:11:34 +1000 Subject: [PATCH 1/4] #16 sops download and add to path --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index 234d184..71d5b56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,11 @@ RUN curl -LO "https://dl.k8s.io/release/v${KUBE_VERSION}/bin/linux/amd64/kubectl chmod +x kubectl && \ mv kubectl /usr/local/bin +ARG SOPS_VERSION=3.8.0 +RUN curl -LO "https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.amd64" && \ + mv "sops-v${SOPS_VERSION}.linux.amd64" /usr/local/bin/sops && \ + chmod +x /usr/local/bin/sops + FROM python:3-slim-bullseye ARG DEBIAN_FRONTEND=noninteractive @@ -33,6 +38,7 @@ ARG DEBIAN_FRONTEND=noninteractive COPY --from=builder /usr/local/bin/terraform /usr/local/bin/terraform COPY --from=builder /usr/local/aws-cli /usr/local/aws-cli COPY --from=builder /usr/local/bin/kubectl /usr/local/bin/kubectl +COPY --from=builder /usr/local/bin/sops /usr/local/bin/sops RUN ln -s /usr/local/aws-cli/v2/current/dist/aws /usr/local/bin/aws && \ apt-get update && \ From 62ddcb5b5f334984f15b36a4539f7383ff9c22fa Mon Sep 17 00:00:00 2001 From: Lisan Chen Date: Tue, 26 Sep 2023 17:02:21 +1000 Subject: [PATCH 2/4] #16 downloading to temp directory instead of working directory, and cleanup --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 71d5b56..93b47c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,9 +27,10 @@ RUN curl -LO "https://dl.k8s.io/release/v${KUBE_VERSION}/bin/linux/amd64/kubectl mv kubectl /usr/local/bin ARG SOPS_VERSION=3.8.0 -RUN curl -LO "https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.amd64" && \ - mv "sops-v${SOPS_VERSION}.linux.amd64" /usr/local/bin/sops && \ - chmod +x /usr/local/bin/sops +RUN curl -L "https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.amd64" -o "/tmp/sops.linux.amd64" && \ + mv "/tmp/sops.linux.amd64" /usr/local/bin/sops && \ + chmod +x /usr/local/bin/sops && \ + rm -rf "/tmp/sops.linux.amd64" FROM python:3-slim-bullseye From 3773d31d649b225d9897a40df051efeb46b1703b Mon Sep 17 00:00:00 2001 From: Lisan Chen Date: Fri, 29 Sep 2023 10:20:09 +1000 Subject: [PATCH 3/4] #16 simplifying and removing redundant removes --- Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 93b47c6..2575199 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,10 +27,8 @@ RUN curl -LO "https://dl.k8s.io/release/v${KUBE_VERSION}/bin/linux/amd64/kubectl mv kubectl /usr/local/bin ARG SOPS_VERSION=3.8.0 -RUN curl -L "https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.amd64" -o "/tmp/sops.linux.amd64" && \ - mv "/tmp/sops.linux.amd64" /usr/local/bin/sops && \ - chmod +x /usr/local/bin/sops && \ - rm -rf "/tmp/sops.linux.amd64" +RUN curl -L "https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.amd64" -o "/usr/local/bin/sops" && \ + chmod +x /usr/local/bin/sops FROM python:3-slim-bullseye From b57a5930ee2e648810a1cc76e3cd1de24544e7c8 Mon Sep 17 00:00:00 2001 From: Lisan Chen Date: Fri, 29 Sep 2023 10:28:21 +1000 Subject: [PATCH 4/4] #16 adding curl timeout and max retries --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2575199..40395cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,7 @@ RUN curl -LO "https://dl.k8s.io/release/v${KUBE_VERSION}/bin/linux/amd64/kubectl mv kubectl /usr/local/bin ARG SOPS_VERSION=3.8.0 -RUN curl -L "https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.amd64" -o "/usr/local/bin/sops" && \ +RUN curl --connect-timeout 30 --retry 5 -L "https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.amd64" -o "/usr/local/bin/sops" && \ chmod +x /usr/local/bin/sops FROM python:3-slim-bullseye