From 27a133a8c3ed0cebc9b8b6ec2221e61b4ca8c61f Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Wed, 21 Oct 2020 20:29:09 +0200 Subject: [PATCH] cicd: build and push binary-only and dind images containing k3d --- .drone.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 4 ++++ 2 files changed, 48 insertions(+) diff --git a/.drone.yml b/.drone.yml index 6b967777..0f27a3ab 100644 --- a/.drone.yml +++ b/.drone.yml @@ -101,6 +101,50 @@ steps: - "refs/tags/*beta*" - "refs/tags/*alpha*" + - name: docker_build_push_dind + image: plugins/docker + settings: + repo: rancher/k3d + tags: + - latest-dind + - "${DRONE_TAG}-dind" + dockerfile: Dockerfile + target: dind + context: . + username: + from_secret: docker_username + password: + from_secret: docker_password + depends_on: + - lint + - test + - build + when: + event: + - tag + + - name: docker_build_push_binary + image: plugins/docker + settings: + repo: rancher/k3d + tags: + - latest + - "${DRONE_TAG}" + dockerfile: Dockerfile + target: dind + context: . + username: + from_secret: docker_username + password: + from_secret: docker_password + depends_on: + - lint + - test + - build + when: + event: + - tag + services: # Starting the docker service to be used by dind - name: docker diff --git a/Dockerfile b/Dockerfile index dc9a2d10..004ae545 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,3 +9,7 @@ RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s chmod +x ./kubectl && \ mv ./kubectl /usr/local/bin/kubectl COPY --from=builder /app/bin/k3d /bin/k3d + +FROM scratch as binary-only +COPY --from=builder /app/bin/k3d /bin/k3d +ENTRYPOINT ["/bin/k3d"] \ No newline at end of file