From f9f7c13bb9bedb044d1ef650c065c1f825426e21 Mon Sep 17 00:00:00 2001 From: Willis Chou Date: Wed, 30 Jun 2021 22:53:15 +0800 Subject: [PATCH 1/2] feat(dockerfile) simplify base image and gather up tools --- Dockerfile | 43 +++++++++++++++++++++++++++---------------- README.md | 4 ++-- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa70563..e0a375a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,26 @@ -FROM seitk/pipeline-eks AS builder +FROM alpine:3.7 AS builder + +RUN apk add --update --no-cache -t \ + deps \ + ca-certificates \ + curl \ + python \ + py-pip \ + jq \ + git \ + openssh \ + groff \ + less \ + mailcap \ + bash \ + && pip install --upgrade pip \ + && pip install --no-cache-dir awscli==1.16.270 \ + && apk del py-pip \ + && rm -rf /var/cache/apk/* /root/.cache/pip/* + +# kubectl +RUN curl -LO https://dl.k8s.io/release/v1.21.0/bin/linux/amd64/kubectl \ + && install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl # gomplate RUN curl -LO https://github.com/hairyhenderson/gomplate/releases/download/v3.6.0/gomplate_linux-amd64-slim \ && chmod +x ./gomplate_linux-amd64-slim \ @@ -6,7 +28,9 @@ RUN curl -LO https://github.com/hairyhenderson/gomplate/releases/download/v3.6.0 # helm v3.2.4 RUN curl -LO https://get.helm.sh/helm-v3.2.4-linux-amd64.tar.gz \ && tar -xvf helm-v3.2.4-linux-amd64.tar.gz \ - && mv ./linux-amd64/helm /usr/local/bin/helm3 + && mv ./linux-amd64/helm /usr/local/bin/helm +# helm diff +RUN helm plugin install https://github.com/databus23/helm-diff # git crypt RUN apk add --update alpine-sdk make libressl-dev RUN git clone https://github.com/AGWA/git-crypt.git \ @@ -16,17 +40,4 @@ RUN git clone https://github.com/AGWA/git-crypt.git \ # aliyun cli v3.0.14 RUN curl -L -O https://github.com/aliyun/aliyun-cli/releases/download/v3.0.14/aliyun-cli-linux-amd64.tar.gz \ && tar zxvf aliyun-cli-linux-amd64.tar.gz \ - && sudo mv aliyun /usr/local/bin/aliyun -# # terraform 0.13.2 -RUN curl -L -O https://releases.hashicorp.com/terraform/0.13.2/terraform_0.13.2_linux_amd64.zip \ - && unzip terraform_0.13.2_linux_amd64.zip -d /usr/local/bin -FROM seitk/pipeline-eks -# git crypt require duplicity (gpg) -RUN apk add duplicity zip -COPY --from=builder /usr/local/bin/gomplate /usr/local/bin/gomplate -COPY --from=builder /usr/local/bin/helm3 /usr/local/bin/helm3 -COPY --from=builder /usr/local/bin/git-crypt /usr/local/bin/git-crypt -COPY --from=builder /usr/local/bin/aliyun /usr/local/bin/aliyun -COPY --from=builder /usr/local/bin/terraform /usr/local/bin/terraform -# helm diff -RUN helm3 plugin install https://github.com/databus23/helm-diff + && sudo mv aliyun /usr/local/bin/aliyun \ No newline at end of file diff --git a/README.md b/README.md index 8bacfbb..779c556 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Usage -The Dockerfile base on https://hub.docker.com/r/seitk/pipeline-eks and include gomplate, git-crypt, helm3 and aliyun cli 3.0.14 +The Docker image includes some common tools for pipeline works with EKS, likes gomplate, git-crypt, helm, kubectl and awscli. 1. docker build -t /pipeline-eks: . @@ -8,4 +8,4 @@ The Dockerfile base on https://hub.docker.com/r/seitk/pipeline-eks and include g ## Docker Image -shoplineapp/pipeline-eks:0.7 +shoplineapp/pipeline-eks \ No newline at end of file From 3b93a1ec4c329778072f221802587460c9271d53 Mon Sep 17 00:00:00 2001 From: Willis Chou Date: Wed, 30 Jun 2021 22:55:43 +0800 Subject: [PATCH 2/2] feat(dockerfile) remove aliyun cli --- Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e0a375a..d4af127 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,8 +36,4 @@ RUN apk add --update alpine-sdk make libressl-dev RUN git clone https://github.com/AGWA/git-crypt.git \ && cd git-crypt \ && make \ - && make install PREFIX=/usr/local -# aliyun cli v3.0.14 -RUN curl -L -O https://github.com/aliyun/aliyun-cli/releases/download/v3.0.14/aliyun-cli-linux-amd64.tar.gz \ - && tar zxvf aliyun-cli-linux-amd64.tar.gz \ - && sudo mv aliyun /usr/local/bin/aliyun \ No newline at end of file + && make install PREFIX=/usr/local \ No newline at end of file