From d926063a6e25121b169f79ebbc3b9778c09c393f Mon Sep 17 00:00:00 2001 From: Hanjo Meinhardt Date: Fri, 24 Aug 2018 14:12:11 +0200 Subject: [PATCH] added kubectl to image --- .drone.yml | 14 +++++++------- Dockerfile | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index d4932ca..d0ed112 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,21 +1,21 @@ pipeline: - build: - image: alpine:edge - commands: - - sed -i 's@@${VERSION}@' Dockerfile - docker: image: plugins/docker repo: bunix42/google-cloud-sdk build_args: - BASE_IMAGE=google/cloud-sdk:${VERSION} + - KUBECTL_VERSION=${KUBECTL_VERSION} tags: - - ${VERSION} + - ${VERSION}_kubectl-${KUBECTL_VERSION} secrets: [ docker_username, docker_password ] when: branch: master matrix: VERSION: - - 193.0.0-alpine \ No newline at end of file + - 193.0.0-alpine + KUBECTL_VERSION: + - v1.9.10 + - v1.10.7 + - v1.11.2 diff --git a/Dockerfile b/Dockerfile index 38fe17b..664b626 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,3 +3,8 @@ FROM $BASE_IMAGE RUN apk add -U --no-cache openssl +# download and install kubectl +ARG KUBECTL_VERSION + +RUN curl -L https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl -o /usr/bin/kubectl \ + && chmod +x /usr/bin/kubectl