Skip to content

Commit cefdb2d

Browse files
committed
Fixes for Makefile Commands
Why these changes are being introduced: After going through the process with the marimo-launcher application, there were a few minor lessons-learned that are reflected in this slightly updated Makefile template. How this addresses that need: * Fix the tagging for containers generated by the `make publish-dev` command Side effects of this change: None. Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/IN-1481
1 parent cba0e96 commit cefdb2d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

files/makefile-cpu-arch.tpl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dist-dev: check-arch ## Build docker container (intended for developer-based man
2626
docker buildx use $(ECR_NAME_DEV); \
2727
docker buildx build --platform $(CPU_ARCH) \
2828
--load \
29+
--tag $(ECR_URL_DEV):$$ARCH_TAG \
2930
--tag $(ECR_URL_DEV):make-$$ARCH_TAG \
3031
--tag $(ECR_URL_DEV):make-$(shell git describe --always) \
3132
--tag $(ECR_NAME_DEV):$$ARCH_TAG \
@@ -34,9 +35,11 @@ dist-dev: check-arch ## Build docker container (intended for developer-based man
3435
publish-dev: dist-dev ## Build, tag and push (intended for developer-based manual publish)
3536
@ARCH_TAG=$$(cat .arch_tag); \
3637
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $(ECR_URL_DEV); \
38+
docker push $(ECR_URL_DEV):$$ARCH_TAG; \
3739
docker push $(ECR_URL_DEV):make-$$ARCH_TAG; \
3840
docker push $(ECR_URL_DEV):make-$(shell git describe --always); \
39-
docker push $(ECR_URL_DEV):make-$(shell echo $(CPU_ARCH) | cut -d'/' -f2)
41+
echo "Cleaning up dangling Docker images..."; \
42+
docker image prune -f --filter "dangling=true"
4043

4144
### If this is a Lambda repo, uncomment the two lines below ###
4245
# update-lambda-dev: ## Updates the lambda with whatever is the most recent image in the ecr (intended for developer-based manual update)
@@ -49,9 +52,9 @@ publish-dev: dist-dev ## Build, tag and push (intended for developer-based manua
4952
docker-clean: ## Clean up Docker detritus
5053
@ARCH_TAG=$$(cat .arch_tag); \
5154
echo "Cleaning up Docker leftovers (containers, images, builders)"; \
55+
docker rmi -f $(ECR_URL_DEV):$$ARCH_TAG; \
5256
docker rmi -f $(ECR_URL_DEV):make-$$ARCH_TAG; \
5357
docker rmi -f $(ECR_URL_DEV):make-$(shell git describe --always) || true; \
54-
docker rmi -f $(ECR_URL_DEV):make-$(shell echo $(CPU_ARCH) | cut -d'/' -f2) || true; \
5558
docker rmi -f $(ECR_NAME_DEV):$$ARCH_TAG || true; \
5659
docker buildx rm $(ECR_NAME_DEV) || true
5760
@rm -rf .arch_tag

0 commit comments

Comments
 (0)