From 9a9987eeb22ceaaa8b6f3062a0e96b627da9fe9b Mon Sep 17 00:00:00 2001 From: Ivan Krylov Date: Tue, 23 Aug 2022 12:30:34 +0100 Subject: [PATCH] fix issue --- Dockerfile | 2 ++ Dockerfile.multistage | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 Dockerfile.multistage diff --git a/Dockerfile b/Dockerfile index 8b08db3..2ecd7ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ FROM alpine/helm:3.8.1 MAINTAINER Joachim Hill-Grannec +RUN apk add libc6-compat + COPY build/drone-helm /bin/drone-helm COPY assets/kubeconfig.tpl /root/.kube/config.tpl diff --git a/Dockerfile.multistage b/Dockerfile.multistage new file mode 100644 index 0000000..cf42bdd --- /dev/null +++ b/Dockerfile.multistage @@ -0,0 +1,33 @@ +# syntax=docker/dockerfile:1 +## Build +FROM golang:1.13 AS build + +WORKDIR /app + +COPY go.mod ./ +COPY go.sum ./ + +COPY cmd cmd +COPY internal internal +COPY assets assets + +# test +RUN go test ./cmd/... ./internal/... +RUN go vet ./cmd/... ./internal/... + +# Build binary +RUN go build -o build/drone-helm cmd/drone-helm/main.go + +## Deploy +FROM alpine/helm:3.8.1 + +RUN apk add libc6-compat + +# COPY build/drone-helm /bin/drone-helm +COPY --from=build /app/build/drone-helm /bin/drone-helm +COPY assets/kubeconfig.tpl /root/.kube/config.tpl + +LABEL description="Helm 3 plugin for Drone 3" +LABEL base="alpine/helm" + +ENTRYPOINT [ "/bin/drone-helm" ]