diff --git a/image/cli-base/Dockerfile b/image/cli-base/Dockerfile index 35014b5..5d92552 100644 --- a/image/cli-base/Dockerfile +++ b/image/cli-base/Dockerfile @@ -9,7 +9,7 @@ ARG ARCHITECTURE USER root RUN dnf update -y --skip-broken --nobest &&\ dnf upgrade -y --skip-broken --nobest &&\ - dnf install nano jq libxcrypt-compat cpio -y &&\ + dnf install nano jq libxcrypt-compat cpio bash-completion -y &&\ dnf clean all # 2. Upgrade pip, install wheel, then install Python modules @@ -51,7 +51,8 @@ RUN bash /tmp/remediate.sh # 6. Cleanup RUN rm -rf /tmp/* -# 11. Setup working environment + +# 7. Setup working environment WORKDIR /mascli ENTRYPOINT ["/tini", "--"] CMD bash diff --git a/image/cli-base/install/install-argocd.sh b/image/cli-base/install/install-argocd.sh index c50aa75..2b0ba9f 100644 --- a/image/cli-base/install/install-argocd.sh +++ b/image/cli-base/install/install-argocd.sh @@ -27,4 +27,7 @@ curl -sSL -o argocd-linux-${TARGET_PLATFORM} https://github.com/argoproj/argo-cd rm argocd-linux-${TARGET_PLATFORM} echo "ArgoCD version:" -argocd version --client \ No newline at end of file +argocd version --client + +# Enable autocompletion for helm +argocd completion bash > /etc/bash_completion.d/argocd_completion diff --git a/image/cli-base/install/install-aws.sh b/image/cli-base/install/install-aws.sh index 6f456ae..1be4db7 100644 --- a/image/cli-base/install/install-aws.sh +++ b/image/cli-base/install/install-aws.sh @@ -44,4 +44,7 @@ unzip -q awscliv2.zip rm -rf aws rm awscliv2.zip echo "AWS version:" -aws --version \ No newline at end of file +aws --version + +# Set up bash completion for aws +ln -s /usr/local/bin/aws_completer /etc/bash_completion.d/aws_completion diff --git a/image/cli-base/install/install-helm.sh b/image/cli-base/install/install-helm.sh index 03d24fc..84449ca 100644 --- a/image/cli-base/install/install-helm.sh +++ b/image/cli-base/install/install-helm.sh @@ -38,4 +38,7 @@ else chmod 777 /usr/local/bin/helm fi echo "Helm version:" -helm version \ No newline at end of file +helm version + +# Enable autocompletion for helm +helm completion bash > /etc/bash_completion.d/helm_completion diff --git a/image/cli-base/install/install-oc.sh b/image/cli-base/install/install-oc.sh index 66ad318..6e96b25 100644 --- a/image/cli-base/install/install-oc.sh +++ b/image/cli-base/install/install-oc.sh @@ -9,7 +9,7 @@ do --target-platform) TARGET_PLATFORM="$2" ;; - + *) # unknown option, use as additional params directly to docker EXTRA_PARAMS="$EXTRA_PARAMS $key $2" @@ -41,3 +41,7 @@ mv oc-mirror /usr/local/bin/ chmod +x /usr/local/bin/oc-mirror rm -f oc-mirror.tar.gz rm -f /opt/app-root/src/.oc-mirror.log + +# Enable bash completion for oc and kubectl +oc completion bash > /etc/bash_completion.d/oc_completion +kubectl completion bash > /etc/bash_completion.d/kubectl_completion