Skip to content

Commit

Permalink
chore: use build args in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
gacevicljubisa committed Nov 5, 2024
1 parent 0088bc6 commit de64883
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
FROM golang:1.22 AS build

ARG REACHABILITY_OVERRIDE_PUBLIC=false
ARG BATCHFACTOR_OVERRIDE_PUBLIC=5

WORKDIR /src
# enable modules caching in separate layer
COPY go.mod go.sum ./
RUN go mod download
COPY . ./

RUN make binary
# Run make binary with specified arguments
RUN make binary \
REACHABILITY_OVERRIDE_PUBLIC=$REACHABILITY_OVERRIDE_PUBLIC \
BATCHFACTOR_OVERRIDE_PUBLIC=$BATCHFACTOR_OVERRIDE_PUBLIC

FROM debian:12.4-slim

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ build:

.PHONY: docker-build
docker-build:
docker build -t $(IMAGE) . --no-cache
docker build \
--build-arg REACHABILITY_OVERRIDE_PUBLIC=$(REACHABILITY_OVERRIDE_PUBLIC) \
--build-arg BATCHFACTOR_OVERRIDE_PUBLIC=$(BATCHFACTOR_OVERRIDE_PUBLIC) \
-t $(IMAGE) . --no-cache

.PHONY: githooks
githooks:
Expand Down

0 comments on commit de64883

Please sign in to comment.