From f22dfc977a758c9414f23c1fc334878a428a01c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Mon, 12 Feb 2024 13:00:58 +0100 Subject: [PATCH] toolbox-cloud-cli: Add gcloud & doctl cli --- toolbox-cloud-cli/Containerfile | 17 +++++++++++++++++ toolbox-cloud-cli/google-cloud-sdk.repo | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 toolbox-cloud-cli/google-cloud-sdk.repo diff --git a/toolbox-cloud-cli/Containerfile b/toolbox-cloud-cli/Containerfile index 76eb7c3..b04a714 100644 --- a/toolbox-cloud-cli/Containerfile +++ b/toolbox-cloud-cli/Containerfile @@ -1,11 +1,18 @@ FROM registry.fedoraproject.org/fedora-toolbox:39 +# Can not use herdocs here until GitHub workflows move to a newer Ubuntu +# release with a newer buildah: +# - https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/ +# - https://github.com/containers/buildah/issues/3474 +COPY google-cloud-sdk.repo /etc/yum.repos.d/google-cloud-sdk.repo + # - Install cloud cli tools # - Remove mlocate RUN dnf -y distrosync && \ dnf -y install \ awscli \ azure-cli \ + google-cloud-cli \ oci-cli \ vim \ zsh \ @@ -13,6 +20,16 @@ RUN dnf -y distrosync && \ dnf -y remove mlocate && \ dnf clean all +ARG DOCTL_URL="https://github.com/digitalocean/doctl/releases/download/v1.104.0/doctl-1.104.0-linux-amd64.tar.gz" +ARG DOCTL_SHA256SUMS="f758b0c2fb7857db2bd00439155154f2ab8bee71c4f3640f90f64ec35256ca53 doctl-1.104.0-linux-amd64.tar.gz" + +# Manually install doctl +RUN wget "${DOCTL_URL}" && \ + echo "${DOCTL_SHA256SUMS}" | sha256sum --check && \ + tar xf doctl-*-linux-amd64.tar.gz && \ + rm doctl-*-linux-amd64.tar.gz && \ + install -o 0 -g 0 -m 755 doctl /usr/local/bin/doctl + # No need to clear the output as we will never use ZSH as a login shell and # this clears output when exiting toolboxes. RUN sed -i '/clear/d' /etc/zlogout diff --git a/toolbox-cloud-cli/google-cloud-sdk.repo b/toolbox-cloud-cli/google-cloud-sdk.repo new file mode 100644 index 0000000..e0bc693 --- /dev/null +++ b/toolbox-cloud-cli/google-cloud-sdk.repo @@ -0,0 +1,7 @@ +[google-cloud-cli] +name=Google Cloud CLI +baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el9-x86_64 +enabled=1 +gpgcheck=1 +repo_gpgcheck=0 +gpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg