From 9b20f75495b3efe64741f20bac48c88a366b9e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Odstr=C4=8Dil=C3=ADk?= Date: Wed, 13 Nov 2024 13:26:02 +0100 Subject: [PATCH] fix(dockerfile): auto-detect GOOS, GOARCH --- Dockerfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0659ab8..c026358 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -ARG ALPINE_VERSION=3.19 +ARG ALPINE_VERSION=3.20 FROM python:3.10-alpine${ALPINE_VERSION} as builder_aws_cli -ARG AWS_CLI_VERSION=2.15.19 +ARG AWS_CLI_VERSION=2.20.00 RUN apk add --no-cache git unzip groff build-base libffi-dev cmake RUN git clone --single-branch --depth 1 -b ${AWS_CLI_VERSION} https://github.com/aws/aws-cli.git @@ -21,9 +21,6 @@ RUN (cd /usr/local/lib/aws-cli; for a in *.so*; do test -f /lib/$a && rm $a; don FROM golang:1.22-alpine${ALPINE_VERSION} as builder_golang -ARG GOOS=linux -ARG GOARCH=amd64 - RUN apk --update add ca-certificates WORKDIR $GOPATH/src/github.com/lablabs/aws-service-quotas-exporter @@ -34,7 +31,7 @@ RUN go mod vendor RUN go mod verify RUN cd cmd/exporter && \ - GOOS=$GOOS GOARCH=$GOARCH \ + GOOS=${TARGETOS} GOARCH=${TARGETARCH} \ CGO_ENABLED=0 \ go build -o /aws-service-quotas-exporter .