Skip to content

Commit

Permalink
fix(dockerfile): auto-detect GOOS, GOARCH
Browse files Browse the repository at this point in the history
  • Loading branch information
jaygridley committed Nov 13, 2024
1 parent ef3784a commit 9b20f75
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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 .

Expand Down

0 comments on commit 9b20f75

Please sign in to comment.