From 017ba8156e6e115282abab89b48a699ac8b5412d Mon Sep 17 00:00:00 2001 From: Myers Carpenter Date: Mon, 7 Jan 2019 17:31:10 -0500 Subject: [PATCH] work correctly for non-alpine based Dockerfiles --- Dockerfile | 12 +++--------- plugin.sh | 28 +++++++++++++++++----------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4322667..f32767a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,11 @@ -FROM gcr.io/kaniko-project/executor:v0.7.0 AS kaniko +FROM gcr.io/kaniko-project/executor:debug-v0.7.0 -FROM alpine:3.8 - -# clone the official kaniko container into this one, env vars needs to be re-set -COPY --from=kaniko / / ENV HOME /root ENV USER /root ENV SSL_CERT_DIR=/kaniko/ssl/certs ENV DOCKER_CONFIG /kaniko/.docker/ ENV DOCKER_CREDENTIAL_GCR_CONFIG /kaniko/.config/gcloud/docker_credential_gcr_config.json -RUN apk add --update --no-cache jq - # add the wrapper which acts as a drone plugin -COPY plugin.sh /usr/bin/ -ENTRYPOINT [ "/usr/bin/plugin.sh" ] +COPY plugin.sh /kaniko/plugin.sh +ENTRYPOINT [ "/kaniko/plugin.sh" ] diff --git a/plugin.sh b/plugin.sh index 6fb1f2e..d494c98 100755 --- a/plugin.sh +++ b/plugin.sh @@ -1,15 +1,14 @@ -#!/bin/sh +#!/busybox/sh set -euo pipefail export PATH=$PATH:/kaniko/ -if [[ -n "${PLUGIN_USERNAME}" ]]; then - DOCKER_AUTH=`echo -n "${PLUGIN_USERNAME}:${PLUGIN_PASSWORD}" | base64` +DOCKER_AUTH=`echo -n "${PLUGIN_USERNAME}:${PLUGIN_PASSWORD}" | base64` - REGISTRY=${PLUGIN_REGISTRY:-https://index.docker.io/v1/} +REGISTRY=${PLUGIN_REGISTRY:-https://index.docker.io/v1/} - cat > /kaniko/.docker/config.json < /kaniko/.docker/config.json <