From 151becb9e3a6677c07c8c4bec774ba0c572798b1 Mon Sep 17 00:00:00 2001 From: Rael Garcia Date: Mon, 5 Dec 2022 20:40:20 +0000 Subject: [PATCH 1/2] feat: add gh cli Signed-off-by: Rael Garcia --- Dockerfile | 14 ++++++++++++++ Dockerfile-ci | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2e3d435..bab86c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,18 @@ FROM golang:1.19.3-bullseye as go RUN GO111MODULE=on go install github.com/raviqqe/liche@latest +FROM alpine:3.17 as gh + +ENV GITHUB_CLI_VERSION=2.0.0 +ADD https://github.com/cli/cli/releases/download/v${GITHUB_CLI_VERSION}/gh_${GITHUB_CLI_VERSION}_linux_amd64.tar.gz /tmp/gh.tgz + +RUN tar \ + --strip-components=2 \ + --extract \ + --file /tmp/gh.tgz \ + gh_${GITHUB_CLI_VERSION}_linux_amd64/bin/gh && \ + mv -v gh /bin/gh + FROM debian:stable-20221114-slim ENV DEBIAN_FRONTEND noninteractive @@ -41,6 +53,8 @@ COPY --from=terraform /bin/terraform /usr/bin COPY --from=regctl /usr/local/bin/regctl /usr/bin +COPY --from=gh /bin/gh /usr/bin + ENV GO_BIN /go/bin ENV PATH "$GO_BIN:$PATH" diff --git a/Dockerfile-ci b/Dockerfile-ci index 36230b3..5ef31a1 100644 --- a/Dockerfile-ci +++ b/Dockerfile-ci @@ -9,12 +9,24 @@ RUN apk add --update git RUN GO111MODULE=on go install github.com/raviqqe/liche@latest +FROM alpine:3.17 as gh + +ENV GITHUB_CLI_VERSION=2.0.0 +ADD https://github.com/cli/cli/releases/download/v${GITHUB_CLI_VERSION}/gh_${GITHUB_CLI_VERSION}_linux_amd64.tar.gz /tmp/gh.tgz + +RUN tar \ + --strip-components=2 \ + --extract \ + --file /tmp/gh.tgz \ + gh_${GITHUB_CLI_VERSION}_linux_amd64/bin/gh && \ + mv -v gh /bin/gh + FROM alpine:3.17 ENV AWSCLI_VERSION 1.18.4 RUN apk add --update \ - git make bash jq curl git && \ + git make bash jq curl gpg gnupg less openssh patch && \ apk --purge -v del py-pip && \ rm -rf /var/cache/apk/* && \ rm -rf $HOME/.cache @@ -23,6 +35,8 @@ COPY --from=terraform /bin/terraform /usr/bin COPY --from=regctl /usr/local/bin/regctl /usr/bin +COPY --from=gh /bin/gh /usr/bin + ENV GO_BIN /go/bin ENV PATH "$GO_BIN:$PATH" From 59c1055a154493a6b3cb0b903d6bab57ddfb580c Mon Sep 17 00:00:00 2001 From: Rael Garcia Date: Mon, 5 Dec 2022 20:41:21 +0000 Subject: [PATCH 2/2] feat: add yq to main image Signed-off-by: Rael Garcia --- Dockerfile | 21 ++++++++++++++++++--- Dockerfile-ci | 20 +++++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index bab86c9..85d85ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,19 @@ RUN tar \ gh_${GITHUB_CLI_VERSION}_linux_amd64/bin/gh && \ mv -v gh /bin/gh +FROM alpine:3.17 as yq + +ENV VERSION=v4.30.5 +ENV BINARY=yq_linux_amd64 + +ADD https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz /tmp/yq.tgz + +RUN tar \ + --extract \ + --file /tmp/yq.tgz \ + ./${BINARY} && \ + mv -v ${BINARY} /bin/yq + FROM debian:stable-20221114-slim ENV DEBIAN_FRONTEND noninteractive @@ -49,11 +62,13 @@ COPY --from=aws /usr/local/aws-cli /usr/local/aws-cli ENV AWS_BIN /usr/local/aws-cli/v2/current/bin ENV PATH "$AWS_BIN:$PATH" -COPY --from=terraform /bin/terraform /usr/bin +COPY --from=terraform /bin/terraform /usr/local/bin + +COPY --from=regctl /usr/local/bin/regctl /usr/local/bin -COPY --from=regctl /usr/local/bin/regctl /usr/bin +COPY --from=gh /bin/gh /usr/local/bin -COPY --from=gh /bin/gh /usr/bin +COPY --from=yq /bin/yq /usr/local/bin ENV GO_BIN /go/bin ENV PATH "$GO_BIN:$PATH" diff --git a/Dockerfile-ci b/Dockerfile-ci index 5ef31a1..1d3b1cf 100644 --- a/Dockerfile-ci +++ b/Dockerfile-ci @@ -21,6 +21,18 @@ RUN tar \ gh_${GITHUB_CLI_VERSION}_linux_amd64/bin/gh && \ mv -v gh /bin/gh +FROM alpine:3.17 as yq + +ENV VERSION=v4.30.5 +ENV BINARY=yq_linux_amd64 + +ADD https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz /tmp/yq.tgz + +RUN tar \ + --extract \ + --file /tmp/yq.tgz \ + ./${BINARY} && mv -v ${BINARY} /usr/local/bin/yq + FROM alpine:3.17 ENV AWSCLI_VERSION 1.18.4 @@ -31,11 +43,13 @@ RUN apk add --update \ rm -rf /var/cache/apk/* && \ rm -rf $HOME/.cache -COPY --from=terraform /bin/terraform /usr/bin +COPY --from=terraform /bin/terraform /usr/local/bin + +COPY --from=regctl /usr/local/bin/regctl /usr/local/bin -COPY --from=regctl /usr/local/bin/regctl /usr/bin +COPY --from=gh /bin/gh /usr/local/bin -COPY --from=gh /bin/gh /usr/bin +COPY --from=yq /usr/local/bin/yq /usr/local/bin ENV GO_BIN /go/bin ENV PATH "$GO_BIN:$PATH"