diff --git a/icq-relayer/Dockerfile b/icq-relayer/Dockerfile index 78f1ae385..0aadf5bef 100644 --- a/icq-relayer/Dockerfile +++ b/icq-relayer/Dockerfile @@ -1,5 +1,8 @@ FROM golang:1.23.2-alpine3.20 as build +ARG VERSION +ARG COMMIT + WORKDIR /src/app RUN apk add --no-cache gcc musl-dev make git @@ -17,7 +20,7 @@ FROM alpine:3.20 RUN apk add --no-cache ca-certificates jq curl -COPY --from=build /src/build/icq-relayer /usr/local/bin/icq-relayer +COPY --from=build /src/app/icq-relayer /usr/local/bin/icq-relayer RUN adduser -S -h /icq -D icq -u 1000 diff --git a/icq-relayer/Makefile b/icq-relayer/Makefile index 80c1d41f2..600236268 100644 --- a/icq-relayer/Makefile +++ b/icq-relayer/Makefile @@ -1,18 +1,17 @@ .PHONY: build -QSVERSION := $(shell grep github.com/quicksilver-zone/quicksilver go.mod | grep -Eo 'v[0-9]\.[0-9]\.[0-9].*') -COMMIT := $(shell git log -1 --format='%H') -VERSION=$(shell git describe --tags | grep 'icq-relayer' | head -n1 | sed 's/.*\///') +QSVERSION ?= $(shell grep github.com/quicksilver-zone/quicksilver go.mod | grep -Eo 'v[0-9]\.[0-9]\.[0-9].*') +COMMIT ?= $(shell git log -1 --format='%H') +VERSION ?= $(shell git describe --tags | grep 'icq-relayer' | head -n1 | sed 's/.*\///') ldflags = -X github.com/quicksilver-zone/quicksilver/icq-relayer/pkg/runner.VERSION=icq-relayer/$(VERSION) \ -X github.com/quicksilver-zone/quicksilver/icq-relayer/pkg/runner.COMMIT=$(COMMIT) \ -X github.com/quicksilver-zone/quicksilver/icq-relayer/pkg/runner.QUICKSILVER_VERSION=$(QSVERSION) build: - go build -ldflags '$(ldflags)' -o ../build - + go build -ldflags '$(ldflags)' docker: - docker build -f Dockerfile . -t quicksilverzone/interchain-queries:$(VERSION) + docker build -f Dockerfile . -t quicksilverzone/interchain-queries:$(VERSION) --build-arg VERSION=$(VERSION) --build-arg COMMIT=$(COMMIT) dockerx: docker buildx build --platform linux/amd64 -f Dockerfile . -t quicksilverzone/interchain-queries:$(VERSION)