Skip to content

Commit

Permalink
docker build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Bowman committed Oct 24, 2024
1 parent 810ff81 commit a6a7dd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 4 additions & 1 deletion icq-relayer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
11 changes: 5 additions & 6 deletions icq-relayer/Makefile
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit a6a7dd6

Please sign in to comment.