Skip to content

Commit

Permalink
Fix for building with APP_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
elabpro committed Nov 1, 2024
1 parent 75a3bb8 commit 5487b1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM golang:1.22 as builder
ARG APP_VERSION=no-APP_VERSION-supplied-in-buildtime
RUN mkdir /app
WORKDIR /app
COPY . /app
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ build-macos: lint pre-build

build: lint pre-build
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags=${LDFLAGS} -o ${BUILD_DIR}/${BINARY_NAME} main.go
strip bin/${BINARY_NAME}
strip ${BUILD_DIR}/${BINARY_NAME}

clear:
rm -rf bin/${BINARY_NAME}
rm -rf ${BUILD_DIR}/${BINARY_NAME}

dep:
go mod download

docker:
docker build --force-rm -t $(BINARY_NAME) .
docker build --force-rm -t $(BINARY_NAME) --build-arg APP_VERSION=${APP_VERSION} .

test:
if [ "$(shell uname)" = "Linux" ]; then make build; else make build-macos; fi
Expand Down

0 comments on commit 5487b1b

Please sign in to comment.