11
22# vars
3+ IMAGE_BASE =scanoss-py-base
34IMAGE_NAME =scanoss-py
45REPO =scanoss
6+ DOCKER_FULLNAME_BASE =${REPO}/${IMAGE_BASE}
57DOCKER_FULLNAME =${REPO}/${IMAGE_NAME}
8+ GHCR_FULLNAME_BASE =ghcr.io/${REPO}/${IMAGE_BASE}
69GHCR_FULLNAME =ghcr.io/${REPO}/${IMAGE_NAME}
710VERSION =$(shell ./version.py)
811
@@ -55,15 +58,19 @@ package_all: dist publish ## Build & Publish Python package to PyPI
5558
5659ghcr_build : dist # # Build GitHub container image with local arch
5760 @echo " Building GHCR container image..."
58- docker build -t $(GHCR_FULLNAME ) .
61+ docker build --target with_entry_point -t $(GHCR_FULLNAME ) .
62+
63+ ghcr_build_base : dist # # Build GitHub container base image with local arch (no entrypoint)
64+ @echo " Building GHCR base container image..."
65+ docker build --target no_entry_point -t $(GHCR_FULLNAME_BASE ) .
5966
6067ghcr_amd64 : dist # # Build GitHub AMD64 container image
6168 @echo " Building GHCR AMD64 container image..."
62- docker build -t $(GHCR_FULLNAME ) --platform linux/amd64 .
69+ docker build --target with_entry_point - t $(GHCR_FULLNAME ) --platform linux/amd64 .
6370
6471ghcr_arm64 : dist # # Build GitHub ARM64 container image
6572 @echo " Building GHCR ARM64 container image..."
66- docker build -t $(GHCR_FULLNAME ) --platform linux/arm64 .
73+ docker build --target with_entry_point - t $(GHCR_FULLNAME ) --platform linux/arm64 .
6774
6875ghcr_tag : # # Tag the latest GH container image with the version from Python
6976 @echo " Tagging GHCR latest image with $( VERSION) ..."
@@ -76,21 +83,25 @@ ghcr_push: ## Push the GH container image to GH Packages
7683
7784ghcr_release : dist # # Build/Publish GitHub multi-platform container image
7885 @echo " Building & Releasing GHCR multi-platform container image $( VERSION) ..."
79- docker buildx build --push -t $(GHCR_FULLNAME ) :$(VERSION ) --platform linux/arm64,linux/amd64 .
86+ docker buildx build --push --target with_entry_point - t $(GHCR_FULLNAME ) :$(VERSION ) --platform linux/arm64,linux/amd64 .
8087
8188ghcr_all : ghcr_release # # Execute all GHCR container actions
8289
83- docker_build : # # Build Docker container image with local arch
90+ docker_build : dist # # Build Docker container image with local arch
91+ @echo " Building Docker image..."
92+ docker build --no-cache --target with_entry_point -t $(DOCKER_FULLNAME ) .
93+
94+ docker_build_base : dist # # Build Docker container image with local arch
8495 @echo " Building Docker image..."
85- docker build --no-cache -t $(DOCKER_FULLNAME ) .
96+ docker build --no-cache --target no_entry_point - t $(DOCKER_FULLNAME_BASE ) .
8697
8798docker_amd64 : dist # # Build Docker AMD64 container image
8899 @echo " Building Docker AMD64 container image..."
89- docker build -t $(DOCKER_FULLNAME ) --platform linux/amd64 .
100+ docker build --target with_entry_point - t $(DOCKER_FULLNAME ) --platform linux/amd64 .
90101
91102docker_arm64 : dist # # Build Docker ARM64 container image
92103 @echo " Building Docker ARM64 container image..."
93- docker build -t $(DOCKER_FULLNAME ) --platform linux/arm64 .
104+ docker build --target with_entry_point - t $(DOCKER_FULLNAME ) --platform linux/arm64 .
94105
95106docker_tag : # # Tag the latest Docker container image with the version from Python
96107 @echo " Tagging Docker latest image with $( VERSION) ..."
@@ -103,6 +114,6 @@ docker_push: ## Push the Docker container image to DockerHub
103114
104115docker_release : dist # # Build/Publish Docker multi-platform container image
105116 @echo " Building & Releasing Docker multi-platform container image $( VERSION) ..."
106- docker buildx build --push -t $(DOCKER_FULLNAME ) :$(VERSION ) --platform linux/arm64,linux/amd64 .
117+ docker buildx build --push --target with_entry_point - t $(DOCKER_FULLNAME ) :$(VERSION ) --platform linux/arm64,linux/amd64 .
107118
108119docker_all : docker_release # # Execute all DockerHub container actions
0 commit comments