From 98bb4e4ba4ac4ef58b25a5f83e1133bf5a697cf2 Mon Sep 17 00:00:00 2001 From: Joachim Hill-Grannec Date: Tue, 23 Aug 2022 09:31:37 -0600 Subject: [PATCH] explicitly target linux amd64 --- .drone.yml | 5 ++++- Dockerfile | 2 -- Dockerfile.multistage | 33 --------------------------------- 3 files changed, 4 insertions(+), 36 deletions(-) delete mode 100644 Dockerfile.multistage diff --git a/.drone.yml b/.drone.yml index 66984fa..fe37c37 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,6 +2,9 @@ kind: pipeline type: docker name: default +platform: + os: linux + arch: amd64 steps: - name: test @@ -16,7 +19,7 @@ steps: - name: build image: golang:1.13 commands: - - go build -o build/drone-helm cmd/drone-helm/main.go + - GOOS=linux GOARCH=amd64 go build -o build/drone-helm cmd/drone-helm/main.go - name: publish_linux_amd64 image: plugins/docker settings: diff --git a/Dockerfile b/Dockerfile index 2ecd7ca..8b08db3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,6 @@ 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 deleted file mode 100644 index cf42bdd..0000000 --- a/Dockerfile.multistage +++ /dev/null @@ -1,33 +0,0 @@ -# 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" ]