Skip to content

Commit

Permalink
Makefile: support passing an IMAGE_TAG
Browse files Browse the repository at this point in the history
Signed-off-by: Albin Kerouanton <[email protected]>
  • Loading branch information
akerouanton committed Sep 25, 2024
1 parent 84fc2ee commit f326d99
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
IMAGE_TAG = albinkerouanton006/iptables-tracer:latest
IMAGE_TAG ?= latest
IMAGE = albinkerouanton006/iptables-tracer:$(IMAGE_TAG)
BUILD_OPTS =

ifdef BUILDER
Expand All @@ -7,16 +8,16 @@ endif

.PHONY: build
build:
docker build --platform linux/amd64,linux/arm64 --load ${BUILD_OPTS} -t ${IMAGE_TAG} --target=final .
docker build --platform linux/amd64,linux/arm64 --load ${BUILD_OPTS} -t ${IMAGE} --target=final .

.PHONY: push
push:
docker push $(IMAGE_TAG)
docker push $(IMAGE)

.PHONY: binary
binary: build-push
binary: build
if [ ! -d bin/ ]; then mkdir bin; fi
undock --include=/bin docker-daemon://${IMAGE_TAG} .
undock --include=/bin docker-daemon://${IMAGE} .

install:
sudo cp bin/iptables-tracer /usr/local/sbin/iptables-tracer

0 comments on commit f326d99

Please sign in to comment.