Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/upstream/main' into jpetaz…
Browse files Browse the repository at this point in the history
…zo-main

# Conflicts:
#	Dockerfile
#	README.md
  • Loading branch information
BretFisher committed Sep 11, 2024
2 parents 2eea4a1 + a4d8fcb commit 4ce102e
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 19 deletions.
69 changes: 56 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ ENV BUILDARCH=$BUILDARCH \
TARGETARCH=$TARGETARCH
COPY helper-* /bin/

# https://github.com/argoproj/argo-cd/releases/latest
FROM builder AS argocd
RUN helper-curl bin argocd \
https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-@GOARCH

# https://github.com/docker/compose/releases
FROM builder AS compose
ARG COMPOSE_VERSION=2.17.2
Expand All @@ -18,6 +23,12 @@ FROM builder AS crane
RUN go install github.com/google/go-containerregistry/cmd/crane@latest
RUN cp $(find bin -name crane) /usr/local/bin

# https://github.com/fluxcd/flux2/releases
FROM builder AS flux
ARG FLUX_VERSION=2.3.0
RUN helper-curl tar flux \
https://github.com/fluxcd/flux2/releases/download/v$FLUX_VERSION/flux_${FLUX_VERSION}_linux_@GOARCH.tar.gz

# https://github.com/helm/helm/releases
FROM builder AS helm
ARG HELM_VERSION=3.11.2
Expand All @@ -28,10 +39,11 @@ RUN helper-curl tar "--strip-components=1 linux-@GOARCH/helm" \
# (The source is small enough, so I don't know if cross-compilation
# would be worth the effort.)
FROM alpine AS httping
RUN apk add build-base gettext git musl-libintl ncurses-dev
RUN git clone https://salsa.debian.org/debian/httping
WORKDIR /httping
RUN apk add build-base cmake gettext git musl-libintl ncurses-dev
RUN git clone https://github.com/folkertvanheusden/httping
WORKDIR httping

Check warning on line 44 in Dockerfile

View workflow job for this annotation

GitHub Actions / Call Docker Build / Build+Push

Relative workdir without an absolute workdir declared within the build can have unexpected results if the base image changes

WorkdirRelativePath: Relative workdir "httping" can have unexpected results if the base image changes More info: https://docs.docker.com/go/dockerfile/rule/workdir-relative-path/
RUN sed -i s/60/0/ utils.c
RUN cmake .
RUN make install BINDIR=/usr/local/bin

# https://github.com/simeji/jid/releases
Expand All @@ -50,27 +62,39 @@ FROM builder AS kompose
RUN helper-curl bin kompose \
https://github.com/kubernetes/kompose/releases/latest/download/kompose-linux-@GOARCH

# https://github.com/kubecolor/kubecolor/releases
FROM builder AS kubecolor
ARG KUBECOLOR_VERSION=0.3.2
RUN helper-curl tar kubecolor \
https://github.com/kubecolor/kubecolor/releases/download/v${KUBECOLOR_VERSION}/kubecolor_${KUBECOLOR_VERSION}_linux_@GOARCH.tar.gz

# https://github.com/kubernetes/kubernetes/releases
FROM builder AS kubectl
ARG KUBECTL_VERSION=1.26.3
ARG KUBECTL_VERSION=1.30.2
RUN helper-curl bin kubectl \
https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/@GOARCH/kubectl

# https://github.com/stackrox/kube-linter/releases
FROM builder AS kube-linter
ARG KUBELINTER_VERSION=v0.6.1
ARG KUBELINTER_VERSION=v0.6.8
RUN go install golang.stackrox.io/kube-linter/cmd/kube-linter@$KUBELINTER_VERSION
RUN cp $(find bin -name kube-linter) /usr/local/bin

# https://github.com/doitintl/kube-no-trouble/releases
FROM builder AS kubent
ARG KUBENT_VERSION=0.7.2
RUN helper-curl tar kubent \
https://github.com/doitintl/kube-no-trouble/releases/download/${KUBENT_VERSION}/kubent-${KUBENT_VERSION}-linux-@GOARCH.tar.gz

# https://github.com/bitnami-labs/sealed-secrets/releases
FROM builder AS kubeseal
ARG KUBESEAL_VERSION=0.20.2
ARG KUBESEAL_VERSION=0.27.0
RUN helper-curl tar kubeseal \
https://github.com/bitnami-labs/sealed-secrets/releases/download/v$KUBESEAL_VERSION/kubeseal-$KUBESEAL_VERSION-linux-@GOARCH.tar.gz

# https://github.com/kubernetes-sigs/kustomize/releases
FROM builder AS kustomize
ARG KUSTOMIZE_VERSION=5.0.1
ARG KUSTOMIZE_VERSION=5.4.2
RUN helper-curl tar kustomize \
https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v$KUSTOMIZE_VERSION/kustomize_v${KUSTOMIZE_VERSION}_linux_@GOARCH.tar.gz

Expand All @@ -86,7 +110,7 @@ RUN helper-curl tar popeye \

# https://github.com/regclient/regclient/releases
FROM builder AS regctl
ARG REGCLIENT_VERSION=0.4.7
ARG REGCLIENT_VERSION=0.6.1
RUN helper-curl bin regctl \
https://github.com/regclient/regclient/releases/download/v$REGCLIENT_VERSION/regctl-linux-@GOARCH

Expand All @@ -106,41 +130,51 @@ RUN helper-curl bin skaffold \

# https://github.com/stern/stern/releases
FROM builder AS stern
ARG STERN_VERSION=1.24.0
ARG STERN_VERSION=1.30.0
RUN helper-curl tar stern \
https://github.com/stern/stern/releases/download/v${STERN_VERSION}/stern_${STERN_VERSION}_linux_@GOARCH.tar.gz

# https://github.com/tilt-dev/tilt/releases
FROM builder AS tilt
ARG TILT_VERSION=0.32.0
ARG TILT_VERSION=0.33.17
RUN helper-curl tar tilt \
https://github.com/tilt-dev/tilt/releases/download/v${TILT_VERSION}/tilt.${TILT_VERSION}.linux-alpine.@WTFARCH.tar.gz

# https://github.com/vmware-tanzu/velero/releases
FROM builder AS velero
ARG VELERO_VERSION=1.14.0
RUN helper-curl tar "--strip-components=1 velero-v${VELERO_VERSION}-linux-@GOARCH/velero" \
https://github.com/vmware-tanzu/velero/releases/download/v${VELERO_VERSION}/velero-v${VELERO_VERSION}-linux-@GOARCH.tar.gz

# https://github.com/carvel-dev/ytt/releases
FROM builder AS ytt
ARG YTT_VERSION=0.45.0
ARG YTT_VERSION=0.49.1
RUN helper-curl bin ytt \
https://github.com/carvel-dev/ytt/releases/download/v${YTT_VERSION}/ytt-linux-@GOARCH

# https://github.com/carvel-dev/kapp/releases
FROM builder AS kapp
ARG YTT_VERSION=0.55.0
ARG YTT_VERSION=0.62.1
RUN helper-curl bin kapp \
https://github.com/carvel-dev/kapp/releases/download/v${YTT_VERSION}/kapp-linux-@GOARCH

FROM alpine AS shpod
ENV COMPLETIONS=/usr/share/bash-completion/completions
RUN apk add --no-cache apache2-utils bash bash-completion curl docker-cli file gettext git iputils jq libintl ncurses openssh openssl screen sudo tmux tree vim yq

COPY --from=argocd /usr/local/bin/argocd /usr/local/bin
COPY --from=compose /usr/local/bin/docker-compose /usr/local/bin
COPY --from=crane /usr/local/bin/crane /usr/local/bin
COPY --from=flux /usr/local/bin/flux /usr/local/bin
COPY --from=helm /usr/local/bin/helm /usr/local/bin
COPY --from=httping /usr/local/bin/httping /usr/local/bin
COPY --from=jid /usr/local/bin/jid /usr/local/bin
COPY --from=k9s /usr/local/bin/k9s /usr/local/bin
COPY --from=kapp /usr/local/bin/kapp /usr/local/bin
COPY --from=kubectl /usr/local/bin/kubectl /usr/local/bin
COPY --from=kubecolor /usr/local/bin/kubecolor /usr/local/bin
COPY --from=kube-linter /usr/local/bin/kube-linter /usr/local/bin
COPY --from=kubent /usr/local/bin/kubent /usr/local/bin
COPY --from=kubeseal /usr/local/bin/kubeseal /usr/local/bin
COPY --from=kustomize /usr/local/bin/kustomize /usr/local/bin
COPY --from=ngrok /usr/local/bin/ngrok /usr/local/bin
Expand All @@ -150,10 +184,13 @@ COPY --from=ship /usr/local/bin/ship /usr/local/bin
COPY --from=skaffold /usr/local/bin/skaffold /usr/local/bin
COPY --from=stern /usr/local/bin/stern /usr/local/bin
COPY --from=tilt /usr/local/bin/tilt /usr/local/bin
COPY --from=velero /usr/local/bin/velero /usr/local/bin
COPY --from=ytt /usr/local/bin/ytt /usr/local/bin

RUN set -e ; for BIN in \
argocd \
crane \
flux \
helm \
kapp \
kubectl \
Expand All @@ -162,9 +199,10 @@ RUN set -e ; for BIN in \
regctl \
skaffold \
tilt \
velero \
ytt \
; do echo $BIN ; $BIN completion bash > $COMPLETIONS/$BIN.bash ; done ;\
yq shell-completion bash > $COMPLETIONS/yq.bash
stern --completion bash > $COMPLETIONS/stern

RUN cd /tmp \
&& git clone https://github.com/ahmetb/kubectx \
Expand Down Expand Up @@ -207,10 +245,12 @@ COPY setup-tailhist.sh /usr/local/bin
# Generate a list of all installed versions.
RUN ( \
ab -V | head -n1 ;\
argocd version --client | head -n1 ;\
bash --version | head -n1 ;\
curl --version | head -n1 ;\
docker version --format="Docker {{.Client.Version}}" ;\
envsubst --version | head -n1 ;\
flux --version ;\
git --version ;\
jq --version ;\
ssh -V ;\
Expand All @@ -223,8 +263,10 @@ RUN ( \
jid --version ;\
echo "k9s $(k9s version | grep Version)" ;\
kapp --version | head -n1 ;\
echo "kubecolor $(kubecolor --kubecolor-version)" ;\
echo "kubectl $(kubectl version --short --client)" ;\
echo "kube-linter $(kube-linter version)" ;\
echo "kubent $(kubent --version 2>&1)" ;\
kubeseal --version ;\
kustomize version --short ;\
ngrok version ;\
Expand All @@ -234,6 +276,7 @@ RUN ( \
echo "skaffold $(skaffold version)" ;\
echo "stern $(stern --version | grep ^version)" ;\
echo "tilt $(tilt version)" ;\
echo "velero $(velero version --client-only | grep Version)" ;\
) > versions.txt

# If there is a tty, give us a shell.
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ To execute it:
curl https://k8smastery.com/shpod.sh | sh
```

(Note: It used to be available at shpod.sh and shpod.me, but these
became pretty expensive so I decided to drop them. If you were using
them and want something fast to type, switch to shpod.in!)

If you don't like `curl|sh`, and/or if you want to execute things
step by step, check the next section.

Expand Down Expand Up @@ -184,9 +188,9 @@ that ConfigMap and use it to populate `~/.kube/config`.

This lets you inject a custom kubeconfig file into shpod.

## Support for other architectures
## Multi-arch support

As of November 2021, the Dockerfile in this repository should be able
to build images for other architectures. However, when trying to install
a compiled binary that is not available for another architecture, a dummy
placeholder will be installed instead.
Shpod supports both Intel and ARM 64 bits architectures. The Dockerfile
in this repository should be able to support other architectures fairly
easily. If a given tool isn't available on the target architecture,
a dummy placeholder will be installed instead.
3 changes: 2 additions & 1 deletion bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ KUBE_PS1_NS_COLOR="green"
PS1="\e[1m\e[31m[\$HOSTIP] \e[0m(\$(kube_ps1)) \e[34m\u@\h\e[35m \w\e[0m\n$ "

export EDITOR=vim
export KUBECOLOR_LIGHT_BACKGROUND=true
export PATH="$HOME/.krew/bin:$PATH"

alias k=kubectl
alias k=kubecolor
complete -F __start_kubectl k
. /usr/share/bash-completion/completions/kubectl.bash

Expand Down
1 change: 1 addition & 0 deletions motd
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
🔎 Check "/versions.txt" to see the list of included tools.
🔗 See https://github.com/bretfisher/shpod for more information.
📦️ You can install extra packages with 'sudo apk add PKGNAME'.
🎨 Dark terminal background? Unset KUBECOLOR_LIGHT_BACKGROUND.

1 change: 1 addition & 0 deletions tmux.conf
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set -g status-style bg=blue,fg=white,bold
set-option -g history-limit 1000000

0 comments on commit 4ce102e

Please sign in to comment.