<commit_before>FROM ubuntu:17.10

ARG BUILD_DATE
ARG IMAGE_VERSION
ARG VCS_REF
ARG KUBECTL_VERSION=1.9.1
ARG KUBECTX_VERSION=0.4.0
ARG ISTIO_VERSION=0.4.0
ARG HELM_VERSION=2.7.2
ARG ARK_VERSION=0.6.0

# Metadata as defined at http://label-schema.org
LABEL maintainer="<NAME>" \
      org.label-schema.schema-version="1.0" \
      org.label-schema.vendor="Paul Bouwer" \
      org.label-schema.name="Kubernetes CLI Toolset" \
      org.label-schema.version=$IMAGE_VERSION \
      org.label-schema.license="MIT" \
      org.label-schema.description="Provides the following Kubernetes cli toolset - kubectl $KUBECTL_VERSION, kubectx/kubens $KUBECTX_VERSION, istioctl $ISTIO_VERSION, helm $HELM_VERSION, and ark $ARK_VERSION." \
      org.label-schema.build-date=$BUILD_DATE \
      org.label-schema.vcs-url="https://github.com/paulbouwer/k8s-cli-toolset.git" \
      org.label-schema.vcs-ref=$VCS_REF \
      org.label-schema.docker.cmd="docker run -it --rm -v \${HOME}/.kube:/root/.kube -v \${HOME}/.helm:/root/.helm paulbouwer/k8s-cli-toolset:$IMAGE_VERSION"

# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
        bash-completion \
        ca-certificates \
        curl \
        jq \
        less \
        vim \
    && echo ". /etc/bash_completion" >> ~/.bashrc \
    && echo 'PS1="k8s-cli# "' >> ~/.bashrc \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /tmp/install-utils

# Install kubectl 
# License: Apache-2.0
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl \
    && chmod +x ./kubectl \
    && mv ./kubectl /usr/local/bin/kubectl \
    && echo "source <(kubectl completion bash)" >> ~/.bashrc

# Install kubectx/kubens
# License: Apache-2.0
RUN curl -L https://github.com/ahmetb/kubectx/archive/v$KUBECTX_VERSION.tar.gz | tar xz \<commit_msg>Move metadata to OCI image spec annotations.<commit_after>FROM ubuntu:17.10

ARG BUILD_DATE
ARG IMAGE_VERSION
ARG VCS_REF
ARG KUBECTL_VERSION=1.9.1
ARG KUBECTX_VERSION=0.4.0
ARG ISTIO_VERSION=0.4.0
ARG HELM_VERSION=2.7.2
ARG ARK_VERSION=0.6.0

# Metadata as defined in OCI image spec annotations - https://github.com/opencontainers/image-spec/blob/master/annotations.md
LABEL org.opencontainers.image.title="Kubernetes cli toolset" \
      org.opencontainers.image.description="Provides the following Kubernetes cli toolset - kubectl $KUBECTL_VERSION, kubectx/kubens $KUBECTX_VERSION, istioctl $ISTIO_VERSION, helm $HELM_VERSION, and ark $ARK_VERSION." \
      org.opencontainers.image.created=$BUILD_DATE \
      org.opencontainers.image.version=$IMAGE_VERSION \
      org.opencontainers.image.authors="<NAME>" \
      org.opencontainers.image.url="https://hub.docker.com/r/paulbouwer/k8s-cli-toolset/" \
      org.opencontainers.image.documentation="https://github.com/paulbouwer/k8s-cli-toolset" \
      org.opencontainers.image.vendor="<NAME>" \
      org.opencontainers.image.licenses="MIT" \
      org.opencontainers.image.source="https://github.com/paulbouwer/k8s-cli-toolset.git" \
      org.opencontainers.image.revision=$VCS_REF 

# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
        bash-completion \
        ca-certificates \
        curl \
        jq \
        less \
        vim \
    && echo ". /etc/bash_completion" >> ~/.bashrc \
    && echo 'PS1="k8s-cli# "' >> ~/.bashrc \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /tmp/install-utils

# Install kubectl 
# License: Apache-2.0
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl \
    && chmod +x ./kubectl \
    && mv ./kubectl /usr/local/bin/kubectl \
    && echo "source <(kubectl completion bash)" >> ~/.bashrc

# Install kubectx/kubens
# License: Apache-2.0
RUN curl -L https://github.com/ahmetb/kubectx/archive/v$KUBECTX_VERSION.tar.gz | tar xz \
{'fraction_non_alphanumeric': 0.14410705095213588, 'fraction_numerical': 0.015697375193000514, 'mean_word_length': 3.126326963906582, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 18, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6973903', 'n_tokens_mistral': 1481, 'n_tokens_neox': 1431, 'n_words': 237}