Skip to content

Commit

Permalink
Update go // adapt to arm // remove dep
Browse files Browse the repository at this point in the history
  • Loading branch information
tboeghk committed Apr 12, 2024
1 parent f4e48ea commit 5eac635
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
FROM golang:1.9.3-alpine3.7 as backend
FROM golang:1.22.2-alpine3.19 as builder
RUN apk update && apk add ca-certificates curl git make tzdata

RUN mkdir -p /go/src/github.com/banzaicloud/spot-price-exporter
ADD Gopkg.* Makefile /go/src/github.com/banzaicloud/spot-price-exporter/
WORKDIR /go/src/github.com/banzaicloud/spot-price-exporter

RUN make vendor
ADD . /go/src/github.com/banzaicloud/spot-price-exporter

RUN make vendor
RUN go build -o /bin/spot-price-exporter .


FROM alpine:3.7
COPY --from=backend /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=0 /bin/spot-price-exporter /bin
FROM alpine:3.19
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /bin/spot-price-exporter /bin
ENTRYPOINT ["/bin/spot-price-exporter"]
11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,10 @@ license-check: bin/licensei ## Run license check
license-cache: bin/licensei ## Generate license cache
@bin/licensei cache

DEP_VERSION = 0.5.0
bin/dep:
@mkdir -p ./bin/
@curl https://raw.githubusercontent.com/golang/dep/master/install.sh | INSTALL_DIRECTORY=./bin DEP_RELEASE_TAG=v${DEP_VERSION} sh

.PHONY: vendor
vendor: bin/dep ## Install dependencies
bin/dep ensure -vendor-only
vendor: ## Install dependencies
go mod tidy
go install .

all: clean vendor deps fmt vet docker push

Expand Down Expand Up @@ -99,4 +95,3 @@ ineffassign: install-ineffassign

gocyclo: install-gocyclo
gocyclo -over 19 ${GOFILES_NOVENDOR}

9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/banzaicloud/spot-price-exporter

go 1.22

require (
github.com/prometheus/client_golang v0.8.0
github.com/sirupsen/logrus v1.0.4
github.com/aws/aws-sdk-go v1.13.34
)

0 comments on commit 5eac635

Please sign in to comment.