Skip to content

Commit 70f0bd5

Browse files
committed
Docker build use .aws-architecture
Why these changes are being introduced: When a .aws-architecture file is present, docker builds should use this architecture. This will come organically when we get into AWS ECR builds, but this application also includes a convenience 'make docker-build' that should utilize it too. How this addresses that need: * Adds 'CPU_ARCH' env var to top of Makefile Side effects of this change: * None Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/USE-111
1 parent 882ecd9 commit 70f0bd5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
SHELL=/bin/bash
22
DATETIME:=$(shell date -u +%Y%m%dT%H%M%SZ)
3+
CPU_ARCH ?= $(shell cat .aws-architecture 2>/dev/null || echo "linux/amd64")
34

45
help: # Preview Makefile commands
56
@awk 'BEGIN { FS = ":.*#"; print "Usage: make <target>\n\nTargets:" } \
@@ -77,7 +78,7 @@ my-app: # CLI without any arguments, utilizing uv script entrypoint
7778
# Docker
7879
####################################
7980
docker-build: # Build local image for testing
80-
docker build -t python-cli-template:latest .
81+
docker build --platform $(CPU_ARCH) -t python-cli-template:latest .
8182

8283
docker-shell: # Shell into local container for testing
8384
docker run -it --entrypoint='bash' python-cli-template:latest

0 commit comments

Comments
 (0)