blendle / kns

quick Kubernetes Namespace Switcher
ISC License
295 stars 27 forks source link

ktx-preview.sh not found #7

Closed pietervogelaar closed 5 years ago

pietervogelaar commented 5 years ago

I have the following Dockerfile:


WORKDIR /root

RUN apk add --no-cache \
    bash \
    jq \
    curl \
    git \
    openssl \
    groff \
    python3 && \
    pip3 install --upgrade pip && \
    pip3 install awscli==1.16.86

RUN cd /usr/local/bin && \
    curl -sSO https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/linux/amd64/kubectl && \
    chmod u+x kubectl && \
    curl -sSO https://raw.githubusercontent.com/blendle/kns/master/bin/kns && \
    chmod u+x kns && \
    curl -sSO https://raw.githubusercontent.com/blendle/kns/master/bin/ktx && \
    chmod u+x ktx && \
    git clone --quiet --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && \
    ~/.fzf/install && \
    ln -s /root/.fzf/bin/fzf /usr/local/bin/fzf

ENV PAGER='cat'

ENTRYPOINT ["/bin/bash"]

If I run ktx or kns from a bash prompt inside the container, I can see the contexts and namespaces on the left side of the screen. But on the right side of the screen I see:

sh: /usr/local/bin/../helpers/ktx-preview.sh: not found

How can I fix this?

pietervogelaar commented 5 years ago

Nevermind, got it to work with:

RUN apk add --no-cache \
    bash \
    bash-completion \
    jq \
    curl \
    git \
    openssl \
    groff \
    util-linux \
    python3 && \
    pip3 install --upgrade pip && \
    pip3 install awscli==1.16.86

RUN cd /usr/local/bin && \
    curl -sSO https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/linux/amd64/kubectl && \
    chmod u+x kubectl && \
    curl -sSO https://raw.githubusercontent.com/blendle/kns/master/bin/kns && \
    chmod u+x kns && \
    curl -sSO https://raw.githubusercontent.com/blendle/kns/master/bin/ktx && \
    chmod u+x ktx && \
    curl -sSO https://raw.githubusercontent.com/blendle/kns/master/helpers/ktx-preview.sh && \
    chmod u+x ktx-preview.sh && \
    mkdir ../helpers && \
    mv ktx-preview.sh ../helpers/ktx-preview.sh && \
    git clone --quiet --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && \
    ~/.fzf/install && \
    ln -s /root/.fzf/bin/fzf /usr/local/bin/fzf
koenbollen commented 5 years ago

Cheers! Glad you could get it working. 👍