Skip to content

Commit

Permalink
Fix version in the Docker CI Build (#1357)
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko authored Aug 13, 2024
1 parent cdf2cd8 commit da854e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git/
/docker/*
.dockerignore
*.mp4
*.ts
*Dockerfile*
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
FROM golang:1-bullseye as gobuild
FROM golang:1-bullseye AS gobuild

ARG TARGETARCH
ARG TARGETARCH

WORKDIR /src

ADD go.mod go.sum ./
RUN go mod download

ADD . .
RUN make build

ARG GIT_VERSION
ENV GIT_VERSION="${GIT_VERSION}"

RUN make build GIT_VERSION="${GIT_VERSION}"

FROM ubuntu:22.04 AS catalyst

ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -30,6 +31,6 @@ RUN apt update && apt install -yqq \
vnstat \
&& rm -rf /var/lib/apt/lists/*

COPY --from=gobuild /src/build/catalyst-api /bin/catalyst-api
COPY --from=gobuild /src/build/catalyst-api /bin/catalyst-api

CMD ["/bin/catalyst-api"]
CMD ["/bin/catalyst-api"]
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
GO_BUILD_DIR?=build/

ldflags := -X 'github.com/livepeer/catalyst-api/config.Version=$(shell git rev-parse HEAD)'
GIT_VERSION?=$(shell git rev-parse HEAD)
ldflags := -X 'github.com/livepeer/catalyst-api/config.Version=$(GIT_VERSION)'

.PHONY: all
all: build fmt test lint integration-test tidy
Expand Down

0 comments on commit da854e2

Please sign in to comment.