explicitly target linux amd64

This commit is contained in:
Joachim Hill-Grannec 2022-08-23 09:31:37 -06:00
parent e07eb1399b
commit 98bb4e4ba4
No known key found for this signature in database
GPG key ID: 4391E44ED5D6BB46
3 changed files with 4 additions and 36 deletions

View file

@ -2,6 +2,9 @@ kind: pipeline
type: docker type: docker
name: default name: default
platform:
os: linux
arch: amd64
steps: steps:
- name: test - name: test
@ -16,7 +19,7 @@ steps:
- name: build - name: build
image: golang:1.13 image: golang:1.13
commands: 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 - name: publish_linux_amd64
image: plugins/docker image: plugins/docker
settings: settings:

View file

@ -1,8 +1,6 @@
FROM alpine/helm:3.8.1 FROM alpine/helm:3.8.1
MAINTAINER Joachim Hill-Grannec <joachim@pelo.tech> MAINTAINER Joachim Hill-Grannec <joachim@pelo.tech>
RUN apk add libc6-compat
COPY build/drone-helm /bin/drone-helm COPY build/drone-helm /bin/drone-helm
COPY assets/kubeconfig.tpl /root/.kube/config.tpl COPY assets/kubeconfig.tpl /root/.kube/config.tpl

View file

@ -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" ]